You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Schalk <sc...@volume4.co.za> on 2003/08/15 01:15:53 UTC

[ newbie ]

I have installed, hopefully, all the files/packages needed for log4j. I
wrote the log4jInit servlet and it compiled without any problems. I did the
set-up in the web.xml as mentioned in the source course doc. The one thing I
am unsure of is what exactly the log4j.lcf file should contain.

 

Kind Regards

Schalk Neethling

Volume4.Development.Multimedia.Branding

emotionalize.conceptualize.visualize.realize

Tel: +27125468436

Fax: +27125468436

email:schalk@volume4.co.za

web: www.volume4.co.za

 


RE: [ newbie ]

Posted by Schalk <sc...@volume4.co.za>.
Paul

Thanks, I am sure this will provide me with the needed info.

Kind Regards
Schalk Neethling
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:schalk@volume4.co.za
web: www.volume4.co.za
 

:: -----Original Message-----
:: From: Paul Smith [mailto:paul.smith@lawlex.com.au]
:: Sent: Friday, August 15, 2003 2:45 AM
:: To: Log4J Users List
:: Subject: Re: [ newbie ]
:: 
:: On Fri, 2003-08-15 at 09:15, Schalk wrote:
:: > I have installed, hopefully, all the files/packages needed for log4j. I
:: > wrote the log4jInit servlet and it compiled without any problems. I did
:: > the
:: > set-up in the web.xml as mentioned in the source course doc. The one
:: > thing I
:: > am unsure of is what exactly the log4j.lcf file should contain.
:: 
:: Hi,
:: 
:: The log4j.lcf file would contain the Log4j configuration information you
:: wish to use in your circumstances (details of what Appenders to setup,
:: which Logger's they're bound to etc).
:: 
:: You've got 2 formats to choose for this information.  Standard Java
:: property syntax, or in XML.  If you were to rename the 'log4j.lcf' file
:: referenced by your servlet to 'log4j.properties' or 'log4j.xml' Log4j
:: will automatically detect the appropriate style and configure itself.
:: 
:: However if you name it 'log4j.lcf', your servlet will need to  tell
:: Log4j which Configurator class to initialize Log4j.  Right now I am sure
:: your Servlet is either using PropertyConfigurator, or DOMConfigurator to
:: load your log4j.lcf file.
:: 
:: So depending on your properties vs XML feelings, choose one (bearing in
:: mind that the XML DOMConfigurator can specify a couple more things that
:: the PropertyConfigurator can't, but those features may not be important
:: to you right now, and it's pretty straight forward to rewrite a property
:: file into XML).
:: 
:: The details of the format of Properties/XML configuration are defined
:: here:
:: 
:: Properties:
::
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurat
or.htm
:: l
:: (See the doConfigure link)
:: 
:: XML:
::
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/xml/DOMConfigurato
r.ht
:: ml
:: (The link to the DTD is very useful)
:: 
:: There's a couple of great Wiki documents for you to, so check that out:
:: 
:: http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages
:: 
:: in particular, this one is very relevant
:: 
::
http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/Log4JXmlForma
t
:: 
:: I'm sure Ceki won't mind if I plug his book about Log4j, it is excellent
:: reading:
:: 
:: https://www.qos.ch/shop/products/clm_t.jsp
:: 
:: hope this helps!
:: 
:: cheers,
:: 
:: Paul Smith
:: 
:: 
:: ---------------------------------------------------------------------
:: To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
:: For additional commands, e-mail: log4j-user-help@jakarta.apache.org



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


Re: [ newbie ]

Posted by Paul Smith <pa...@lawlex.com.au>.
On Fri, 2003-08-15 at 09:15, Schalk wrote:
> I have installed, hopefully, all the files/packages needed for log4j. I
> wrote the log4jInit servlet and it compiled without any problems. I did
> the
> set-up in the web.xml as mentioned in the source course doc. The one
> thing I
> am unsure of is what exactly the log4j.lcf file should contain.

Hi,

The log4j.lcf file would contain the Log4j configuration information you
wish to use in your circumstances (details of what Appenders to setup,
which Logger's they're bound to etc).

You've got 2 formats to choose for this information.  Standard Java
property syntax, or in XML.  If you were to rename the 'log4j.lcf' file
referenced by your servlet to 'log4j.properties' or 'log4j.xml' Log4j
will automatically detect the appropriate style and configure itself.

However if you name it 'log4j.lcf', your servlet will need to  tell
Log4j which Configurator class to initialize Log4j.  Right now I am sure
your Servlet is either using PropertyConfigurator, or DOMConfigurator to
load your log4j.lcf file.  

So depending on your properties vs XML feelings, choose one (bearing in
mind that the XML DOMConfigurator can specify a couple more things that
the PropertyConfigurator can't, but those features may not be important
to you right now, and it's pretty straight forward to rewrite a property
file into XML).

The details of the format of Properties/XML configuration are defined
here:

Properties:
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurator.html
(See the doConfigure link)

XML:
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/xml/DOMConfigurator.html
(The link to the DTD is very useful)

There's a couple of great Wiki documents for you to, so check that out:

http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages

in particular, this one is very relevant

http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/Log4JXmlFormat

I'm sure Ceki won't mind if I plug his book about Log4j, it is excellent
reading:

https://www.qos.ch/shop/products/clm_t.jsp

hope this helps!

cheers,

Paul Smith


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