Sometimes you want to customize logging level for given package in your application (to see tracing details for example). If you’re using commons-logging library the configuration file is called “commons-logging.properties” and it should be places somewhere on classpath.
org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
priority=1
Then we can configure SimpleLog back-end just declared in simplelog.properties:
org.apache.commons.logging.simplelog.defaultlog=warn
org.apache.commons.logging.simplelog.log.com.mycompany.package=debug
You place those two files on classpath, redeploy application and … NOTHING HAPPENS. Those files aren’t visible!
(more…)
Kiedy człowiek dorasta to zwykle zakłada rodzinę i zaciąga kredyt na mieszkanie żeby mieć gdzie tę rodzinę pomieścić. Konieczność terminowego spłacania swoich zobowiązań powoduje, że warto kontrolować poziom wydatków względem przychodów na koncie w banku by uniknąć przykrych niespodzianek (patrz: przypadek Grecji). Narzędzia raportujące wbudowane w system transakcyjny mBanku ułatwiają taką operację. Przynajmniej ułatwiały – do czasu ostatniej aktualizacji oprogramowania.

(more…)
Most of us are using Web2.0 sites but massive user base that logins every second is a big challenge to system performance. Let’s see how engineers working for MySpace, Facebook and Twitter are doing their job.
Note: all uptime buttons and images below are generated in real-time, you can click on images / baners to see reports with details directly from site-uptime.net.
MySpace

MySpace uptime
(more…)
Recently I observed that AdWords-generated traffic dissapeared from Analytics panel. I thought: WTH?
I checked the logs and saw that URL called by AdWords:
http://my-site.com/?gclid=342343445345....
Generated 403 (Forbidden) server response. That was caused by recent change in Lighttpd filtering rules. I was paying for AdWords traffic but customer hit 403 error page. Ops!
In order to easily spot such problems in future I created the following scanner to easily find all error server responses.
awk '$9>=400' /var/log/lighttpd/access.log | less
If you are boring of 404 errors you can filter them out as well (leaving only 403 / 500 errors for investigation):
awk '$9>=400 && $9 != 404' /var/log/lighttpd/access.log | less
I discovered that the following URLs were inaccessible:
- /robots.txt (exclusion rules for web crawlers)
- /favicon.ico (icon used by web browsers)
Next step could be automation of this check (cron job that will send an alert if errant responses count is higher than N). It’s left as exercise for the reader.
Hibernate is a library that maps database tables to Java objects. Is performance problems arise it’s very easy to add database caching for application using Hibernate (just few options in config file). Hibernate is shipped with EHCache, default cache implementation. It works well and is easy to setup.
Sometimes you have to use another caching library that has no direct support for Hibernate. Here the Hibernate API comes into play. I’ll show you how to plug Websphere’s DistributedMap into Hibernate.
(more…)