0

I have a Application consiting oj JSP, Servlets and cosumes Webservices.I am using lo4j.propetties to log the events.This application is deployed on Weblogic on a Cluster consisting of 2 server on two different Machine.The content of which are

log4j.rootLogger=DEBUG,CA1, FA1

log4j.appender.FA1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FA1.DatePattern = '.'yyy-MM-dd
log4j.appender.FA1.File=ABC.log 
log4j.appender.FA1.layout=org.apache.log4j.PatternLayout
log4j.appender.FA1.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%-5p] - %c - %m%n

log4j.appender.CA1=org.apache.log4j.ConsoleAppender 
log4j.appender.CA1.layout=org.apache.log4j.PatternLayout 
log4j.appender.CA1.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%-5p] - %c - %m%n

The location where these log files are created are

/u01/CRM/domains/e09/domain_CRM/ABC.log and

/u01/CRM/domains/e10/domain_CRM/ABC.log

Since my server are on different machine, I therefore need a centralized loogign Place something like this

/u01/CRM/logs/server1/ABC.log

/u01/CRM/logs/server2/ABC.log

How do I do that

Sankalp
  • 173
  • 2
  • 9
  • 25

1 Answers1

2

Relying on a SocketAppender is the common approach in a clustered enviroment. You'll need an additional log4j server, that will aggregate all your log messages into a shared file. Check out these SO discussions for details:

Community
  • 1
  • 1
Szymon Jednac
  • 2,969
  • 1
  • 29
  • 43
  • No No...i cannot have a extra server.we are only a week for go live...all i can do is to do some changes at code level.. – Sankalp Mar 01 '13 at 10:22
  • Another option is to use a network file system and to write your logs into a shared directory (see restrictions from the first link). You can also keep them in a database or use JMS. – Szymon Jednac Mar 01 '13 at 10:42