Seperate Log Files per Session

40 views
Skip to first unread message

Daniel

unread,
Aug 2, 2011, 8:59:31 AM8/2/11
to log4jdbc
Hey All,

Is is possible to have it so that a new file is created per session,
at the moment all sessions are stored in the same file which could
potentially get massive, a new file created possibly given a name of
<session_id>SQL.log would be great.

Is this possible at the moment? Or is this something being thought
about?

Many Thanks

Daniel

Arthur Blake

unread,
Aug 2, 2011, 9:21:07 AM8/2/11
to log4jdbc
log4jdbc sends all events to SLF4J and then the underlying logger.
Depending on which type of logging system you use, and how creative
you are, you might be able to accomplish that.
For example, logback has an appender, called the "SiftingAppender"
that is designed to do just what you said:

See http://logback.qos.ch/manual/appenders.html#SiftingAppender

However, I'm not sure if the log messages that log4jdbc produces have
enough information needed to sift the events properly.
But the design of log4jdbc is quite simple and I'm sure you could get
it done with some slight changes to log4dbc together with such an
appender.
Reply all
Reply to author
Forward
0 new messages