Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Log4j

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you check which log4j.properties file is being picked up by application1?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic