Juri Strumpflohner
Juri Strumpflohner Juri is a full stack developer and tech lead with a special passion for the web and frontend development. He creates online videos for Egghead.io, writes articles on his blog and for tech magazines, speaks at conferences and holds training workshops. Juri is also a recognized Google Developer Expert in Web Technologies

Logging is useful

2 min read

When I develop some application, I usually add a logging functionality to it. I find logging useful, especially for maintaining the application.
Some bugs cannot be caught with tests and you often neither detect them when using the application. But then, once you release it and a user runs your application, at some point he will for sure get a stacktrace as usual :). A log-file, which keeps track of the latest events and/or failures, is then extremely useful to quickly detect the problem. Initially I started to use log4j, which is a very nice library with a huge amount of functionalities (I didn't for sure find all of them :D ). However I then started to develop my own logger, since I think that if you have your home-made projects, you don't really want to write complicated configuration-files and that stuff. Just load the library and start logging...
So I developed SimpleLog. As the name says, it is a very basic, simple logging utility for Java. My decision was to write all log-entries to an XML file, for which reason SimpleLog also needs to have the JDom library in the build-path of your project. I've chosen that, because this guarantees flexibility. In this way one could also write its own application that does some analysis stuff upon the created xml-log-files, which could be interesting (i.e. failure distribution over classes; failure frequency, etc...).

I've uploaded everything to this location. Before installing please read the Wiki pages, where I gave an example of how to use SimpleLog. If you then decide to use it, it would be nice if you report issues to me such that I can improve it. Here you can find also a sample-log file.
Questions? Thoughts? Hit me up on Twitter
comments powered by Disqus