Results 1 to 2 of 2
Thread: problem with log4j
- 06-26-2009, 08:16 AM #1
Member
- Join Date
- Jun 2009
- Posts
- 1
- Rep Power
- 0
problem with log4j
Hi
can you please tell me if in a package i have 2 files name Test1.java
and Test2.java.
I want Test1.java to give only info messages and Test2.java to give only debug messages.
Is this possible using log4j.properties or log4j.xml or i have to define different log mechanisms for different files.
Thanks in advance
- 06-26-2009, 09:30 AM #2
You need to create log4j.properties file where you write which class you want to info in the logs:
Java Code:log4j.rootLogger=FATAL, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%t | %m%n ....here you write the path to your class....=INFO
Similar Threads
-
Log4j problem - Logs are rolling into the previous date file
By vaibhavborole in forum Advanced JavaReplies: 0Last Post: 04-16-2009, 03:33 PM -
log4j problem.
By dheerajsea123 in forum Advanced JavaReplies: 1Last Post: 12-10-2008, 08:33 AM -
Regarding Log4j
By sidiq in forum New To JavaReplies: 0Last Post: 04-07-2008, 07:35 PM -
Log4j
By chakri in forum New To JavaReplies: 1Last Post: 02-08-2008, 10:15 PM -
Log4J, problem with Hibernate and Spring
By Marcus in forum Advanced JavaReplies: 1Last Post: 06-06-2007, 03:22 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks