Hi,
When Iam using joran configurator in log4j1.3 alpha 8 version, log is written
in folds into log file.ie, first call of execution of my program writes the
text once, for second call it writes twice and the logging is growing
exponentially for subsequent calls.
my code looks like:
JoranConfigurator jc = new JoranConfigurator();
jc.doConfigure("C:\jakarta-tomcat-4.1.30\webapps\log4j.xml",LogManager.getLoggerRepository())
logger.info("test log" );
I tried using the deprecated DOMConfigurator also, but this also behaves the
same ,because DOMConfigurator is extended from JoranConfigurator.
But when i keep the log4j.xml file in classes folder of web application and
not specifying any configurator then the logging is happening perfectly.So i
hope the problem is using JoranConfigurator.
So could any one help me in finding a solution with JoranConfigurator.
Regards,
Rohan
Surya Poola <[EMAIL PROTECTED]> wrote:
Dirk,
I have multiple instance of webapp applications .So currently i tried by
saving my log4j.xml file in WEB-INF/classes folder.
The file is been picked up, but i am getting the same warnings that i got
earlier without any file output( Ihave switched on the debug . mode)
log4j:WARN Continuable parsing error 3 and column 29
log4j:WARN Document root element "configuration", must match DOCTYPE root
"null".
log4j:WARN Continuable parsing error 3 and column 29
log4j:WARN Document is invalid: no grammar found.
log4j:WARN The <configuration> element has been deprecated.
log4j:WARN Use the <log4j:configuration> element instead.
log4j: Threshold ="".
log4j: Level value for root is [info].
log4j: root level set to INFO
log4j: Class name: [org.apache.log4j.rolling.RollingFileAppender]
log4j: Setting property [append] to [true].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{yyyy-MM-dd
HH:mm:ss},%p,%c,%t %m%n].
My log4j.xml file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">
<appender class="org.apache.log4j.rolling.RollingFileAppender"
name="MyFileAppender">
<param name="Append" value="true"/>
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
<param name="FileNamePattern"
value="/pkg/vdqxx/home//jakarta-tomcat-4.1.30/logs/a.log.%d{yyyy-MM)"/>
</rollingPolicy>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss},%p,%c,%t
%m%n"/>
</layout>
</appender>
<root>
<level value="info"/>
<appender-ref ref="MyFileAppender"/>
</root>
</configuration>
and i just given the following stements in my code:
logger=Logger.getLogger (Classname.class);
logger.info("Perormance log Classname");
is the default configurator DOM or Joran .as per the output it looks like DOM.
Can you help me in fixing this issue.
Thanks in advance.
Regards
Rohan
Dirk Ooms <[EMAIL PROTECTED]> wrote:
Rohan,
do you have multiple instances of tomcat or multiple webapps within tomcat?
anyway, typically one puts the log4j.xml in the WEB-INF/classes of each webapp.
it will then be picked up by JoranConfigurator (without doing anything explicit
in your code, except for a getLogger()). Do not use the in version 1.3,
JoranConfigurator does not accept it.
dirk
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------
No need to miss a message. Get email on-the-go
with Yahoo! Mail for Mobile. Get started.
---------------------------------
Any questions? Get answers on any topic at Yahoo! Answers. Try it now.
---------------------------------
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
---------------------------------
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.