This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Urgent...Logging for Two different Enterprise applications using Log4j Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Urgent...Logging for Two different Enterprise applications using Log4j" Watch "Urgent...Logging for Two different Enterprise applications using Log4j" New topic
Author

Urgent...Logging for Two different Enterprise applications using Log4j

Mohsin Kayal
Greenhorn

Joined: Oct 22, 2005
Posts: 23
Dear all,

We have developed two enterprise application (both running under IBM WAS 5.1) that uses Apache's Log4j for logging.

I placed both the log4j-1.2.11.jar & log4j.properties under lib folder. The problem here is I want to create two different files (under two different directories) for those two enterprise applications by using the default log4j.properties file.

My log4j.properties file look like :

log4j.rootLogger=INFO,APP1,APP2

log4j.appender.APP1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.APP1.File=c:\Application1.log
log4j.appender.APP1.layout=org.apache.log4j.PatternLayout
log4j.appender.APP1.DatePattern='.'yyyy-MM-dd

log4j.appender.APP1.layout.ConversionPattern=%d{dd-MM-yyyy HH:mm:ss,SSS} %5p - %x %m%n

log4j.appender.APP2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.APP2.File=c:\Application2.log
log4j.appender.APP2.layout=org.apache.log4j.PatternLayout
log4j.appender.APP2.DatePattern='.'yyyy-MM-dd

log4j.appender.APP2.layout.ConversionPattern=%d{dd-MM-yyyy HH:mm:ss,SSS} %5p - %x %m%n


Pls. provide me the solution.
[ February 14, 2006: Message edited by: Mohsin Kayal ]
 
 
subject: Urgent...Logging for Two different Enterprise applications using Log4j
 
It's not a secret anymore!