Hi If it's not a must to write into the same log file: there are several techniques to separate the logger universes in order that the same package/class writes to different log files. The easiest way is by using the fact that the different apps run in different thread contexts (I assume this is the case):
- Each app sets at the beginning of its livetime some information in the MDC (such as app names, id's, ... ). - You provide a own repository selector which analyzes this MDC informations in order to return an appropriate repository each time a logger is requested. Hope this gives you a hint. Heri > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 07, 2005 11:46 PM > To: [email protected] > Subject: DailyRollingFileAppender writing to previous day's log > > > Hi, > > I am using log4j-1.2.8. Some background information: I > have 3 web applications (.war) running under the same tomcat > instance. All 3 of these web applications write to the same > log file. > > After midnight, a new log file is created, however, something > strange happens. One of the web apps (I believe it depends > on which app writes to the log first), continues to write to > the old log. In fact, it completely overwrites the old log > and begins to log for the current day. For that reason, in > myapp.log.2005.09.05 I will only see logging information for > that app from 09.06, etc, etc. > > The only way to fix this problem is to reset tomcat. After > that point, all the apps will write to the correct file. > This is not a feasible production solution, especially since > the old logs get overwritten. > > The reason we can not split the 3 web applications into 3 > seperate logs is because of shared code (aka the Model > Layer), and we can only configure the logs based on package > name. Therefore all 3 app's model layer will continue to > hit the same log (resulting in the same problem). > > Any help or suggestions would be appreciated! > > Thanks. > > -L > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
