Thanks for your clear explanation Mark.

I am sure that, if the documentation, you are writing will be just as clear
as this mail, it will be very OK ;)

Thank,
Eddie


----- Original Message -----
From: Mark Masterson <[EMAIL PROTECTED]>
To: LOG4J Users Mailing List <[EMAIL PROTECTED]>
Sent: Tuesday, June 05, 2001 7:24 PM
Subject: RE: modifying log levels through a management console


> >>Were can I find a reference of the possible properties of an appender,
for
> example the DailyRollingFileAppender ? <<
>
> There isn't one, yet.  I've just started writing one, but it won't be done
> until the end of July, or mid-August.  That's the short answer:  the long
> answer == in fact, you can find all of the info that I'll put in the
user's
> guide, right now, if you're persistent and patient.  The properties you
can
> set on an Appender, for example, are the same ones that you will find as
> Bean-style "setXXXX" methods in the source code of the Appender class.
> Thus, since DailyRollingFileAppender has a "setDatePattern" method, this
> means that there is a "DatePattern" property that you can set in a config
> file.  Rule of thumb - the config file property is the same as the
> Appender's "setXXX" method, with the "set" removed.  Thus, using an XML
> config file example, for DailyRollingFileAppender, we obtain this element:
>
> <param name="DatePattern" value="'.'yyyy-MM-dd"/>
>
> In Java properties file lingo, this would look something like this:
>
> log4j.appender.A1.DatePattern="'.'yyyy-MM-dd"
>
> Where A1 is previously defined in your config file as a
> DailyRollingFileAppender.
>
> Ceki's explained this logic a few times in the past on this list, so scan
> the archives for more details.
>
> In your example, the easiest way to achieve what you're after is to use
the
> "Threshold" parameter, common to all Appenders, and set its priority as
> appropriate.  To use an XML example:
>
> <appender name="FILE_LOG"
class="org.apache.log4j.DailyRollingFileAppender">
> <param name="File" value="/etc/error.log"/>
> <param name="DatePattern" value="'.'yyyy-MM-dd"/>
>             <param name="Threshold" value="INFO"/>
> <layout class="org.apache.log4j.PatternLayout">
>        <param name="ConversionPattern" value="%d,%p,[%t],[%c],%m%n"/>
> </layout>
> </appender>
>
> <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
>            <param name="Target" value="System.out" />
>             <param name="Threshold" value="DEBUG"/>
>            <layout class="org.apache.log4j.PatternLayout">
>              <param name="ConversionPattern"
value="%d,%p,[%t],[%c],%m%n"/>
>            </layout>
> </appender>
>
> The other most useful place to look for the "secrets of property files" is
> the log4j.dtd, if you're using XML config files.
>
> Cheers,
> Mark
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to