This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Problem with log4j  external configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with log4j  external configuration" Watch "Problem with log4j  external configuration" New topic

Problem with log4j external configuration

venkatesh loganathan

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 -- Logconfig.xml file like below
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="">

<appender name="cmeAppender"
<param name="File" value="Indentify-Log.txt"/>
<param name="Append" value="false"/>

<layout class="org.apache.log4j.PatternLayout"/>

<priority value="debug" />
<appender-ref ref="cmeAppender"/>


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

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


Both my xml and jav pgm are in the same path .Even then iam not able to record the log messages int oa file.

When not specified in external configuration its working fine (i.e programatically logging) .What could be the resaon for this.Can anybody help me out regarding this .Do i need to make any other entry in struts-config.xml etc...

Iam using xdoclet and ant for JBoss 3.2.4 server.

Thanks in advance

Venkatesh Loganathan
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
It seems like your app server cannot find the configuration file in it to log something... I would suggest to consult with the documents available for JBoss Struts related stuff...

If you can log it programmatically, it won't be a big deal... You will find your answer in the manuals and documents of your application server...

Just my 2 cents...

Co-author of SCMAD Exam Guide, Author of JMADPlus
I agree. Here's the link:
subject: Problem with log4j external configuration
Similar Threads
Logging into different files based on parameters
log4j not logging
wierd logging issue with my app
log4j - creating my own file
Getting log4j to write to multiple log files