To log something to the console you have to do two things with log4j:
(1) Configure a console appender in the properties file.
(2) In your
Java code, call one of the Logger methods to write a log entry.
You can find examples in
Short introduction to log4j.
Is there some reason why you think "sql" is a problem?