Most interesting links of August ’13

Sorry folks, this month it will be very brief. I have many more great stuff in the queue but haven’t managed to write it down yet. Next month will be heavy 🙂 Recommended Readings Interested in native vs. webapp? Check out Why mobile web apps are slow (mobile browser much slower, not much real improvements,Continue reading “Most interesting links of August ’13”

Most interesting links of November ’12

Recommended Readings James Roper: Scaling Scala vs Java (recommended by M. Odersky) – writing scalable apps in Scala is much easier then Java because idiomatic Scala uses immutable structures and lends itself naturally to asynchronous processing while doing these things in Java is possible but very unnatural and laborious. “It [Scala] is biased towards scaling,Continue reading “Most interesting links of November ’12”

Most interesting links of January ’12

Recommended Readings Jeff Sutherland: Powerful Strategy for Defect Prevention: Improve the Quality of Your Product – “A classic paper from IBM shows how they systematically reduced defects by analyzing root cause. The cost of implementing this practice is less than the cost of fixing defects that you will have if you do not implement itContinue reading “Most interesting links of January ’12”

AWK: Extract Logs for the Given Date(s) from a Log File

If your log file has entries like these: Then you can use the following bash script snippet to extract logs only for a particular day or consecutive days, including everything – even lines not starting with the date such as stacktraces – between the first log of the date up to the first log ofContinue reading “AWK: Extract Logs for the Given Date(s) from a Log File”

Intro: Java Webapp Monitoring with Hyperic HQ + How to Alert on Too Many Errors in Logs

This post describes how to set up the Java-based open source monitoring tool Hyperic HQ to monitor application server error logs and send a single warning e-mail when there are more of them than a threshold. In the previous post Aggregating Error Logs to Send a Warning Email When Too Many of Them – Log4j,Continue reading “Intro: Java Webapp Monitoring with Hyperic HQ + How to Alert on Too Many Errors in Logs”

Aggregating Error Logs to Send a Warning Email When Too Many of Them – Log4j, Stat4j, SMTPAppender

Our development team wanted to get notified as soon as something goes wrong in our production system, a critical Java web application serving thousands of customers daily. The idea was to let it send us an email when there are too many errors, indicating usually a problem with a database, an external web service, orContinue reading “Aggregating Error Logs to Send a Warning Email When Too Many of Them – Log4j, Stat4j, SMTPAppender”

Most interesting links of May

Recommanded Readings Acceptance testing / Specification by example: Gojko Adzic: Anatomy of a good acceptance test – an example of refactoring a bad acceptance test into a good one – good for learning about pitfalls and how a good one should look like Gojko: Top 10 reasons why teams fail with Acceptance Testing – acceptance testing isContinue reading “Most interesting links of May”

Troubleshooting logging configuration (Log4j, commons-logging)

Did it ever happen to you that your logging didn’t behave as expected? Here are some tips how to find out what’s going on. Commons-logging (since 1.1) Set the system property org.apache.commons.logging.diagnostics.dest to STDOUT (or STDERR or a file name); docs: -Dorg.apache.commons.logging.diagnostics.dest=STDOUT Extract of a sample output (no commons-logging.properties): Extract of a sample output (incorrectContinue reading “Troubleshooting logging configuration (Log4j, commons-logging)”

A logging wrapper around PreparedStatement to provide detailed info upon error

In my java web application I use JDBC to store data in batches into a database. When there is a problem the whole batch insert fails and it’s difficult to find out what data caused it to fail. Therefore I’ve created a wrapper around PreparedStatement that remembers values passed into the various set* methods andContinue reading “A logging wrapper around PreparedStatement to provide detailed info upon error”

Injecting better logging into a binary .class using Javassist

Have you ever been strucked by a completely useless exception message somewhere from the depth of a 3rd party application or library you had to use in your code? Have you ever wanted the bloody nameless programmer to have written a truly informative and helpful error message so that you wouldn’t need to spend hoursContinue reading “Injecting better logging into a binary .class using Javassist”