wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes New to log4j concept-log messages are not appending to logfile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "New to log4j concept-log messages are not appending to logfile" Watch "New to log4j concept-log messages are not appending to logfile" New topic
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: 3274
    
    5

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: 3274
    
    5

Now onto your question, what is the result you are getting? Is there nothing printing out to the expected place?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: New to log4j concept-log messages are not appending to logfile
 
Similar Threads
log4j:WARN No appenders could be found for logger (log4jexample.LogExample).
Logging with axis 1.4 and log4j.
Log4j and Tomcat problem
Log4j Problem
Log4j