Discussions

General J2EE: A Quick Question on Log4J xml config file(s)

  1. A Quick Question on Log4J xml config file(s) (4 messages)

    To all,

    I've got a quick question on Apache related products.
    As you know, when configuring Log4J, you can either config the loggers in the program or config it through an XML config file.

    I would like to know where can I get the cross reference information on all the Appender settings.

    eg. for a RollingFileAppender, you need to config the Name of the file and the max file size for rolling; I know how to set them in a Java program; but I don't know the corresponding Tags in the XML.... (actually the tag names aren't exactly matching the ones in the Java API)

    PS. This is the same to using Apache's Struts; the tag names aren't really matching the related API method names...

    Thanks!

    From Jason (Kusanagihk)

    Threaded Messages (4)

  2. Actually I'd rather use the old ".properties" style. It is much easier to keep IMO.

    This XML-mania is sometimes nonsense...
  3. Hi,

    I came accross this link:

    http://www.javaworld.com/javaforums/printthread.php?Board=TheoryPractice&main=2396&type=post

    Hope it helps,
    Biljana
  4. AsyncAppender[ Go to top ]

    Actually I'd rather use the old ".properties" style. It is much easier to keep IMO.

    This XML-mania is sometimes nonsense...

    Using the AsyncAppender requires the use of DOMConfigurator. So the normal properties file method won't work. If asynchronous logging is a requirement, the the xml properties file is unavoidable. Unless I'm missing something.
  5. Some information[ Go to top ]

    Hi..

    i found some information on the BEA Weblogic configuration Help:
    http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html

    For your question.. here are the parameters I'm using:

      <appender name="custom" class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="/var/logs/custom.log"/>
        <param name="Append" value="true"/>
        <param name="MaxFileSize" value="5000KB"/>
        <param name="maxBackupIndex" value="5"/>