logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Log4J with struts and writing to a file
Date Fri, 15 Dec 2006 18:05:41 GMT

You can't have a well formed XML document without a starting root 
element.  Add the following after the doctype declaration...

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">


At 11:48 AM 12/15/2006, you wrote:
 >Sorry to bother you all again, but I am trying to get log4j to work
 >with files and have recieved an error which I am not certain how to
 > Unfortunately I thought I had everything working correctly yesterday,
 >but it seems that I didn't
 >So it is finding the .xml file, it just has an issue with it saying it
 >isn't well formed.
 >       WARN No appenders could be found for logger
 >(org.apache.struts.util.PropertyMessageResources). (details)
 >       javax.enterprise.system.stream.err
 >The markup in the document following the root element must be
 >well-formed. at com.sun.org.apache.xe... (details)
 >       javax.enterprise.system.stream.err
 >ERROR Could not parse url
 >(details)      javax.enterprise.system.stream.err
 >WARN The markup in the document following the root element must be
 >well-formed. (details)         javax.enterprise.system.stream.err
 >WARN Fatal parsing error 14 and column 4 (details)
 >       javax.enterprise.system.stream.err
 >WARN Document root element "appender", must match DOCTYPE root
 >"log4j:configuration". (details)       javax.enterprise.system.stream.err
 >WARN Continuable parsing error 6 and column 61 (details)
 >       javax.enterprise.system.stream.err
 >DocumentBuilderFactory is:
 >(details)      javax.enterprise.system.stream.out
 >Standard DocumentBuilderFactory search succeded. (details)
 >       javax.enterprise.system.stream.out
 >System property is :null 
(details)     javax.enterprise.system.stream.out
 >Preferred configurator class: org.apache.log4j.xml.DOMConfigurator (details)
 >The xml file that I have is the following:
 ><?xml version="1.0" encoding="UTF-8" ?>
 ><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
 >  <!-- Create a rolling file appender called "T" for the system log -->
 >     <appender name="util" class="org.apache.log4j.FileAppender">
 >        <param name="File"
 >value="/opt/SUNWappserver/domains/domain1/logs/util.log" />
 >        <param name="Append" value="true" />
 >        <layout class="org.apache.log4j.PatternLayout">
 >             <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
 >        </layout>
 >     </appender>
 >  <!-- Configure the root appender -->
 >  <root>
 >    <appender-ref ref="util"/>
 >    <level value="info"/>
 >  </root>
 >Again if anyone can point out if I am doing something blatently stupid
 >please do so.
 >Thanks so much for all your time on the matter.

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message