| Author |
New to log4j concept-log messages are not appending to logfile
|
pradyu.kunchala
Greenhorn
Joined: Nov 10, 2008
Posts: 1
|
|
Hi Everybody, this is Pradyu and am new to log4j concept. Am trying to insert log messages to logfile using log4j.properties file in my web project.. in my servlet am using static Logger logger = Logger.getLogger(New1.class.getName()); PropertyConfigurator.configure("log4j.properties"); logger.debug("dddd"); log4j.properties file :: og4j.rootLogger=debug,console1,A2 #console1 is console Appender log4j.appender.console1=org.apache.log4j.ConsoleAppender log4j.appender.console1.layout=org.apache.log4j.PatternLayout #file1 is for fileappender log4j.appender.file1=org.apache.log4j.FileAppender log4j.appender.file1.File=logfile.log log4j.appender.file1.Append=true log4j.appender.file1.layout=org.apache.log4j.PatternLayout log4j.appender.file1.layout.ConversionPattern=%d{MM-dd@HH:mm:ss} %-5p (%13F:%L) %3x - %m%n thanks a lot pradyu....
|
 |
Martijn Verburg
author
Bartender
Joined: Jun 24, 2003
Posts: 3268
|
|
Hi Pradyu, Can you please change your screen name to meet the Javaranch naming policy, thanks!
|
Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
|
 |
Martijn Verburg
author
Bartender
Joined: Jun 24, 2003
Posts: 3268
|
|
|
Now onto your question, what is the result you are getting? Is there nothing printing out to the expected place?
|
 |
 |
|
|
subject: New to log4j concept-log messages are not appending to logfile
|
|
|