This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes log4j properties files not getting read 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 » Frameworks » Struts
Bookmark "log4j properties files not getting read" Watch "log4j properties files not getting read" New topic
Author

log4j properties files not getting read

venkatesh loganathan
Greenhorn

Joined: Aug 24, 2004
Posts: 14
Hi all
Iam not able to log messages to a file when i try to access log information froma file.I have a log4jconfig -- file like below
---------------------------------------------------------------------------

log4j.rootLogger=debug, stdout, R

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F\:%L) - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
---------------------------------------------------------------------------

And my program which reads this file for logging goes like this



final Logger logger = Logger.getLogger(EditShopperAction.class);
PropertyConfigurator.configure("LogConfig.properties");
logger.debug("Here is some DEBUG");
logger.info("Here is some INFO");
logger.warn("Here is some WARN");
logger.error("Here is some ERROR");
logger.fatal("Here is some FATAL");



Can someone help me in this.

Thanks in advance

Venkatesh Loganthan
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
I'm wondering why you are posting the same topic too many times...

Is that thread the same as this? :roll:


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j properties files not getting read
 
Similar Threads
can some one say what is wrong with my log4j.properties?
How to install log4j in JBuilderX?
Problem with log4j
log4j category
ejb and web app. logging with log4j