Reminiscing this and that, on the web since 1994.
Posted 2009-06-03 18:10. Last updated 2017-06-24 12:00. Tagged java, debugging, jdbc, utveckling.
When developing code with Hibernate (or other Java tools that create
SQL statements for you) it is often a good idea to take a close look
at the generated SQL code, for example if you have performerance
issues.
A very nice and simple way to do that is logdriver by
Ryan Bloom.
(Update 2017-06-24: Unfortunatley, the domain seems to have been lost
to a spam site).
And it’s simple to use! I’ve got a .properties file where I’ve
commented out the ordinary db driver and use logdriver instead. As
simple as this:
Read whole Logdriver
.
Posted 2013-11-14 15:10. Tagged java, development, debugging.
Logging in java is a mess.
For a long time there was no standard way of logging in java, so there
is a lot of 3:rd party solutions.
Apache commons logging, slf4j, and log4j are probably the most used.
By now, there is standard java.util.logging package, but most people
stick to the old 3:rd party solutions.
As we shall see, that isn’t really surprising, since java util logging
kind of sucks.
I have done some exploration of different options for logging in java.
The code I base this text on is available as kaj/explorelogs on
github.
I explore the industry-standard logging packages slf4j, log4j, and
appache commons logging as well as java.util.logging.
And I take a look at the Loggger in play framework 1.x as well as my
own wrapper around log4j.
Read whole Some ways to log stuff in java
.