Problem with Toplink and Log4J

J

Jason Fletcher

OK, here is the problem...

We have a Java web application running in JBoss with Toplink as our
persistence layer. We are trying to modify the logging for the
application. As JBoss uses Log4J already and we are pleased with it,
we are using Log4J for our application's logging as well. We are using
a DailyRollingFileAppender setup to roll every day. This works fine,
however, on initialization we have specified the log4J file writer as
the log writer for Toplink. This works great for one day, until the
file rolls. I believe that Log4J is closing the writer, renaming the
file, creating a new file and opening a writer to the new file (not
necessarily in that order.) This leaves Toplink without a valid writer
and it appears to be swallowing the error so that the database queries
are no longer logged to the file.

Question:

Is there a way to capture the rolling file event from Log4J so that we
can manually reconfigure TopLink's logging?

We would like to avoid manually rolling the file as that code has
already been written in Log4J, but if that is the only option.

Second Question:

Is it possible to dynamically reconfigure TopLink's log output at
runtime, using the Session object from TopLink?

Thanks for your help in advance.
 
Joined
Jun 2, 2009
Messages
1
Reaction score
0
hi

I got the same problem... don't know how to output the logs dynamically, say I just need the logs to be output between 8:00am and 6:00pm everyday. how to enable this?

tks!
Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top