Hi all,

I've a requirement for logging with log4j for each userID and day to a
single file.

The userID is provided as a parameter to the constructor of the first class
of my application.

the logfilename should look like this:

applicationlog.<clientID>.<currentdate>.log

How can that be achived with log4J?

I've seen a posting which shows the usage of MDC to let me log the userID
within the logfile, e.g.  "TIMESTAMP [USERID] - Output of Log". But that
means a real huge logfile per day. The number of clientIDs are restricted to
100, so I've 100 logfiles per day at max.

Is it possible to include some parameters out of the MDC as a filename? To
set the system properties isn't really an option, as each user thread would
override the others.

The problem with a custom appender is, that I would have to specify the
userID in each class constructor I'm using.

Any idea? 

Thanks in advance.

Regards,
Christian

-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to