Logging queries using Log4J

222 views
Skip to first unread message

Ruaghain

unread,
Jun 18, 2009, 4:30:13 AM6/18/09
to log4jdbc
Hi,

I'm looking to use log4jdbc to log our queries, I've changed my
jdbc.properties file to correspond to that listed in the home page and
all works well...the problem that I'm having at the minute is that I'm
unable to get log4j to pickup and log those queries. I've changed my
log4j.properties file to again correspond to the one that you have
defined in the home page - but no joy, am I missing something? I have
the following applicable jars in my lib directory:

log4j-1.2.9.jar
log4jdbc4-1.2alpha2.jar
slf4j-api-1.5.8.jar
slf4j-log4j12-1.5.8.jar

If you require any other information please let me know, any help
would be greatly received.

Regards,
Rowan.

Arthur Blake

unread,
Jun 18, 2009, 8:39:58 AM6/18/09
to log4...@googlegroups.com
It sounds like you have everything set up right-- Can you log directly
to the logs with code? Knowing that would help separate whether it's
a general log4j issue versus a log4jdbc issue.

Ruaghain

unread,
Jun 19, 2009, 10:42:45 AM6/19/09
to log4jdbc
Hi Arthur,

I've set up a rootlogger in my log4j properties file which I log
directly to in the code, and that information appears correctly in my
log file. So it would seem to be log4jdbc - I did however manage to
get it working using the java logger by adding the logging.properties
to the WEB-INF\classes folder, but I'd prefer to have it all working
via log4j if at all possible.

Rowan.

On Jun 18, 1:39 pm, Arthur Blake <arthur.bl...@gmail.com> wrote:
> It sounds like you have everything set up right-- Can you log directly
> to the logs with code?  Knowing that would help separate whether it's
> a general log4j issue versus a log4jdbc issue.
>

Arthur Blake

unread,
Jun 22, 2009, 8:36:07 AM6/22/09
to log4...@googlegroups.com
Did you set up slf4j properly? (Step 2 at
http://code.google.com/p/log4jdbc/) You need to make sure you have
the appropriate slf4j jar for log4j.

Deepak Bajoria

unread,
Jul 24, 2009, 4:50:26 AM7/24/09
to log4jdbc
I am facing the same issue as mentioned below.
The only difference is that i am using log4jdbc3-1.2alpha2.jar because
I am using Java 1.5.
The full set of Jars that i am using are :

log4j-1.2.9.jar
log4jdbc3-1.2alpha2.jar
slf4j-api-1.5.8.jar
slf4j-log4j12-1.5.8.jar
ojdbc14.jar
log4j-1.2.15.jar

I have followed each and every step mentioned on this site :
http://code.google.com/p/log4jdbc/

All the log files get created (sql.log, sqltiming.log, jdbc.log) but
nothing is logged into them.
Only log4jdbc.debug statements are printed on that console which says
that the log4jdbc has been initialized.

I tried logging directly from code and it works perfectly. So i guess
log4j is working fine.

Can you please help and let me know if I am missing something

Thanks In Advance
Deepak


On Jun 22, 1:36 pm, Arthur Blake <arthur.bl...@gmail.com> wrote:
> Did you set up slf4j properly?  (Step 2 athttp://code.google.com/p/log4jdbc/)  You need to make sure you have
> the appropriate slf4j jar for log4j.
>

Arthur Blake

unread,
Jul 24, 2009, 5:08:19 AM7/24/09
to log4jdbc
I chatted with Deepak. It was a simple problem. While doing some
testing he had accidently removed jdbc:log4 from the URL
Now it's working.
Reply all
Reply to author
Forward
0 new messages