Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logging

 
ramesh kothakonda
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using log4j for logging in my struts application.
I kept following lines in my log4j.properties file.
But i am getting the warning message in the console like

log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).

log4j:WARN Please initialize the log4j system properly.

please give me the solution




log4j.rootLogger=DEBUG, A1

log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.file=/com/myapp/struts/monitor.log
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=[%5p] %d{mm:ss} (%F:%M:%L)%n%m%n%n
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the configuration file itself cannot be found. you can either put it in the classpath, or name its location as a vm-argument, i think its

-Dlog4j.configuration=xxx

google is your friend ;-)

jan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic