Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4j

 
abhishek khandelwal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I seek your valuable help with regards to the implementation of Log4j in my application.

We have two different web applications deployed on single websphere application server cluster.
both have different log4j.properties file.

Here are their listing:

Property File for application 1
---------------------------------------------
log4j.rootLogger=DEBUG, ROOT

log4j.appender.ROOT=org.apache.log4j.RollingFileAppender

log4j.appender.ROOT.File=E:\\X\\ApplicationFramework.log

log4j.appender.ROOT.MaxFileSize=500KB

log4j.appender.ROOT.layout=org.apache.log4j.PatternLayout

log4j.appender.ROOT.MaxBackupIndex=5

log4j.appender.ROOT.layout.ConversionPattern=[%d] %t %c %-5p - %m%n

Property File for application 2
---------------------------------------------
log4j.rootLogger=INFO, HELLO

log4j.appender.HELLO=org.apache.log4j.RollingFileAppender

log4j.appender.HELLO.File=E:\\Y\\Hello.log

log4j.appender.HELLO.MaxFileSize=10MB

log4j.appender.HELLO.layout=org.apache.log4j.PatternLayout

log4j.appender.HELLO.MaxBackupIndex=5

log4j.appender.HELLO.layout.ConversionPattern=[%d] %t %c %-5p - %m%n

Problem: The log statements from Application 1 are being written to the Hello.log file.

Could you help me to figure out the problem?
Thanks in Advance!


Abhishek Khandelwal
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check which log4j.properties file is being picked up by application1?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic