Thanks Heri for you advice. The pattern with having the date also for current files is not fix. I can live with the pattern applicationlog.<clientid>.log for the most current log.
Your solution was to implement a custom RepositorySelector, wasn't it? What I can't see in your solution was the place where I set the filename. You've said something about getting the FileAppender? Can you please explain? Christian > --- Original Message --- > From: "Bender Heri" <[EMAIL PROTECTED]> > To: "Log4J Users List" <log4j-user@logging.apache.org> > Subject: RE: Single logfile per User and Day > Sent: Mon, 27 Feb 2006 16:05:45 +0100 > > A possibility to have different logger universes in one JVM instance I > have described last week. See Thread "Use different log files inside one > program". > > Applying this solution you can achieve your wished <clientID> within the > filename. > > The problem of the daily log is solved at best with > DailyRollingFileAppender. But: Placing the date before the extension is not yet supported by > log4j (actual productive release). Currently the DailyRollingFileAppender works > like this: the actual log file has not date, when the file rolls over, the > date is appended to the file name like: <filename>.<ext><datepattern>. I > think next release will have improved possibilities for defining file name > patterns. If your desired pattern (date before extension) is a must for you, > you have to write your own DailyRollingFileAppender. > > Heri > > > -----Original Message----- > > From: Christian Rosenberger [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 27, 2006 3:02 PM > > To: log4j-user@logging.apache.org > > Subject: Single logfile per User and Day > > > > > > 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 > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko! Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]