Hi,
    I hope DOM Configurator doesnot support rollingfileappender(updated in1.3), 
because  elements like rollingpolicy are not identified by DOM Configurator.I 
have checked in log4j.dtd wich allows only some specific elements like 
(errorHandler?,param*,layout?,filter*,appender-ref*)".I have got the following 
warnings:
  
log4j:WARN Continuable parsing error 8 and column 76
log4j:WARN Element type "rollingPolicy" must be declared.
log4j:WARN Continuable parsing error 15 and column 14
log4j:WARN The content of element type "appender" must match 
"(errorHandler?,param*,layout?,filter*,appender-ref*)"
   
  My configuration file lokslike
  <?xml version="1.0" encoding="UTF-8" ?>
  <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
  <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"; 
debug="false">
  <!-- Create a rolling file appender called "T" for the Tomcat system log -->
  <appender class="org.apache.log4j.rolling.RollingFileAppender" name="T">
  <!-- Log files should use today's date and rotate at midnight -->
  <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
  <!-- Set the path and file name pattern for your Tomcat log files -->
  <param name="FileNamePattern" 
value="/pkg/vdcu0/home/bischru0/tomcat/jakarta-tomcat-4.1.30/logs/Viewer.%d.log"/>
  </rollingPolicy>
  <layout class="org.apache.log4j.PatternLayout">
  <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
  </layout>
  </appender>
  <!-- Configure the root appender-->
  <root>
  <level value="info"/>
  <appender-ref ref="T"/>
  </root>
  </log4j:configuration>
   
  I dont want to refer to the log4j.xml statically, because i have many 
instances of tomcat and for each and every instance i will generate log file in 
seperate location.The location of logfile should be changed in a property file 
rather than system property.
   
  so can any one let me know the solution to write to fileusing 
rollingfileappender in log4j1.3.
   
  Thanks in advance.
  Regards
  Rohan
   
  
Jacob Kjome <[EMAIL PROTECTED]> wrote:
  Quoting dirk ooms :

> On Monday 15 January 2007 19:04, Jacob Kjome wrote:
> > The file should look something like this...
> >
> > 
> > > > debug="false" threshold="debug">
>
> AFAIK the tag was used in version 1.2.x, but it is
> inproper xml. In 1.3 this was corrected (or at least an attempt was made) to
> . So it might be that the deprecated DOMConfigurator is still
> expecting ..., but if one relies on the default
> initialization, the tag is expected in version 1.3.
>

Exactly. The deprecated DOMConfigurator still uses the old syntax. I don't
recall whether the JoranConfigurator can deal with the old syntax or not? It's
been a while since I tested that (I think maybe it doesn't). In any case, it
should, just to be backward compatible. Or, at least, JoranConfigurator should
recognize the old syntax and defer to DOMConfigurator in that case. Of course
there's other compatibility gotcha's between 1.2 and 1.3.


Jake

> dirk
>
> >
> > ....
> > ....
> > ....
> >
> > 
> >
> >
> > Jake
> >
> > Quoting Surya Poola :
> > > Hi,
> > > Iam getting the following warnings if iam using DOM Configurator and
> > > iam not getting the log file created:
> > >
> > > log4j:WARN Continuable parsing error 2 and column 16
> > > log4j:WARN Document root element "configuration", must match DOCTYPE root
> > > "null".
> > > log4j:WARN Continuable parsing error 2 and column 16
> > > log4j:WARN Document is invalid: no grammar found.
> > > log4j:WARN The element has been deprecated.
> > > log4j:WARN Use the element instead.
> > >
> > > I hope DOM configurator doesnot support the xml generated for log4j1.3
> > > from (http://wizardforge.org/pc?action=show), like
> > >
> > > 
> > > 
> > > > > > name="MyFileAppender">
> > > 

> > > 
> > > 
> >
> > value="/pkg/vdcu0/home/bischru0/AladinArchiveViewer.d/AladinArchiveViewer.%
> >d{yyyy-MM}.gz"/>
> >
> > > 
> > > 
> > > 
> > > %m%n" />
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> > > I have tried changing the xml as per log4j1.2.x version ,but then also
> > > i am getting the same error.so can anyone suggest me the proper usage of
> > > rollingfielappender in log4j1.3 version.
> > >
> > > Thanks in advance
> > >
> > > Regards
> > > Rohan
> > >
> > > James Stauffer wrote:
> > > Even though DOMConfigurator is depreciated it may still work and it
> > > may be worthwhile to try it to see if your config is ok.
> > >
> > > On 1/15/07, Surya Poola wrote:
> > > > Dirk,
> > > >
> > > > Thanks for your help,but iam sorry to query you once more:
> > > >
> > > > I already have gone through the document.My question is in log4j 1.2.8
> > > > i
> > >
> > > was using the following for DailyRollingFileAppender to map to
> > > configuration
> > >
> > > file :
> > > > DOMConfigurator.configure(mLOG4JCONFIGFILE);
> > > > where mLOG4JCONFIGFILE was the property where i mentioned the location
> > > > of
> > >
> > > xml file.
> > >
> > > > But in 1.3 alpha-8,DOMConfigurator is depracated.
> > > >
> > > > So iam forced to use joranconfigurator, by which iam not able to write
> > > > to
> > >
> > > file,ie, file is not created.I am mentioning my program as follows:
> > > > JoranConfigurator jc = new JoranConfigurator();
> > > > jc.doConfigure(mLOG4JCONFIGFILE, LogManager.getLoggerRepository());
> > > >
> > > > So can you let me kow how to configure with joranconfigurator or any
> > > > other
> > >
> > > configurator.
> > >
> > > > Thanks in advance
> > > >
> > > > Regards
> > > > Rohan
> > > >
> > > > Dirk Ooms wrote:
> > > > Rohan,
> > > >
> > > > have a look at the 'Default Initalization Procedure' at
> > >
> > > http://logging.apache.org/log4j/docs/manual.html
> > >
> > > > it explains how log4j will find your config file.
> > > >
> > > > 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.
> > >
> > > --
> > > James Stauffer http://www.geocities.com/stauffer_james/
> > > Are you good? Take the test at http://www.livingwaters.com/good/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > > ---------------------------------
> > > The fish are biting.
> > > Get more visitors on your site using Yahoo! Search Marketing.
> > >
> > > ---------------------------------
> > > Be a PS3 game guru.
> > > Get your game face on with the latest PS3 news and previews at Yahoo!
> > > Games.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



 
---------------------------------
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
 
---------------------------------
Access over 1 million songs - Yahoo! Music Unlimited.

Reply via email to