Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

log4j configuration

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Struts Framework and log4j. I have log4j.configuration file in my WEB-INF classes directory. Here is what it looks like:
log4j.rootCategory=DEBUG, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apace.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%F:%L] -%m%n
Now, I am getting TONS of messages on the console. I just want to see only the messages from my classes. Can anyone help me on this.
Thanks a lot !
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so you dont want to see output from struts classes.
Struts javadoc indicate that all Struts classes fall under package name that starts with org.apache.struts
So by assuming that struts classes would have retreived the Logger instance by doing
Logger log = Logger.getLogger(struts-specific-classname);
adding the following entry to your log4j.configuration properties
should help you get rid of statements logged with levels of DEBUG and INFO.

Am sure you are interested in seeing messages with log levels of WARN / ERROR/ FATAL etc that get logged from Struts classes.
Not sure if this would work but worth trying anyways.
 
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!