You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Bruce Altner <ba...@hq.nasa.gov> on 2002/01/20 00:40:54 UTC

specifying a logging properties file

Sorry, I just can't figure out from the existing documentation, including 
javadocs, how to point your Logger to an externally provided config file. 
The PropertiesLoggingConfig() class claims that it is a "small helper class 
that encapsulates the logging configuration information...reads its 
information from a Properties file" but nowhere is it stated how to point 
it at your properties file for a given logger.
If this is to be specified in web.xml, what do you name the init parameter? 
If this is set up in TR.props, what property do you tag onto the facility?

I am attempting to do logging using log4j logger and the default case is 
working well. But log4j allows very flexible output formats via properties 
files...I just need to know how to point it to the right one.

Anyone can help?

Thanks,
Bruce


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: specifying a logging properties file

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Bruce Altner <ba...@hq.nasa.gov> writes:

> Sorry, I just can't figure out from the existing documentation,
> including javadocs, how to point your Logger to an externally provided
> config file. The PropertiesLoggingConfig() class claims that it is a
> "small helper class that encapsulates the logging configuration
> information...reads its information from a Properties file" but
> nowhere is it stated how to point it at your properties file for a
> given logger.
> If this is to be specified in web.xml, what do you name the init
> parameter? If this is set up in TR.props, what property do you tag
> onto the facility?
>
> I am attempting to do logging using log4j logger and the default case
> is working well. But log4j allows very flexible output formats via
> properties files...I just need to know how to point it to the right
> one.

I'm not sure how applicable this is for 2.x, but here's how we do it
in 3.0 land:

<http://scarab.tigris.org/source/browse/scarab/src/conf/TurbineResources.properties?rev=1&content-type=text/x-cvsweb-markup>

Log4J properties are at the top of the file.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: specifying a logging properties file

Posted by Philippe PETIT <ph...@noos.fr>.
sorry I made a mistake, as I'm suscriber to different mailing lists I
believed it was a question regarding the logging with JBoss. Sorry for the
noise...
I'll give a look at logging with Turbine. If I find something I'll mail it
to you.
regards.
Philippe

> -----Original Message-----
> From: Chris Shenton [mailto:Chris.Shenton@hq.nasa.gov]
> Sent: Tuesday, January 22, 2002 4:38 PM
> To: Turbine Users List
> Subject: Re: specifying a logging properties file
>
>
> "Philippe PETIT" <ph...@noos.fr> writes:
>
> > So you can customize your outputs by adding properties lines in
> the existing
> > log4j.properties file in the JBoss conf/default directory. You
> do not have
> > to create a new property file, you just add your own needs to
> the existing
> > one.
>
> Doesn't seem to be one in the stock TDK that we're using.  File
> org.apache.turbine.services.logging.LoggingConfig.java seems to set a
> bunch of defaults, but I don't see anything in TR.props (or elsewhere)
> where the log4j.properties should live.
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: specifying a logging properties file

Posted by Chris Shenton <Ch...@hq.nasa.gov>.
"Philippe PETIT" <ph...@noos.fr> writes:

> So you can customize your outputs by adding properties lines in the existing
> log4j.properties file in the JBoss conf/default directory. You do not have
> to create a new property file, you just add your own needs to the existing
> one.

Doesn't seem to be one in the stock TDK that we're using.  File
org.apache.turbine.services.logging.LoggingConfig.java seems to set a
bunch of defaults, but I don't see anything in TR.props (or elsewhere)
where the log4j.properties should live.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: specifying a logging properties file

Posted by Philippe PETIT <ph...@noos.fr>.
Hi,
I'm new to log4j, but I'm using it in EJBs deployed in JBoss 3.0.
In your class file, you just have to import category package :
  // Import log4j classes.
  import org.apache.log4j.Category;

...

and use "cat.info, cat.debug, etc" to log out your comments

So you can customize your outputs by adding properties lines in the existing
log4j.properties file in the JBoss conf/default directory. You do not have
to create a new property file, you just add your own needs to the existing
one.

It works fine for me...
So hope it helps !

Regards,
Philippe

> -----Original Message-----
> From: Bruce Altner [mailto:baltner@hq.nasa.gov]
> Sent: Sunday, January 20, 2002 12:41 AM
> To: Turbine Users List
> Subject: specifying a logging properties file
>
>
> Sorry, I just can't figure out from the existing documentation, including
> javadocs, how to point your Logger to an externally provided config file.
> The PropertiesLoggingConfig() class claims that it is a "small
> helper class
> that encapsulates the logging configuration information...reads its
> information from a Properties file" but nowhere is it stated how to point
> it at your properties file for a given logger.
> If this is to be specified in web.xml, what do you name the init
> parameter?
> If this is set up in TR.props, what property do you tag onto the facility?
>
> I am attempting to do logging using log4j logger and the default case is
> working well. But log4j allows very flexible output formats via
> properties
> files...I just need to know how to point it to the right one.
>
> Anyone can help?
>
> Thanks,
> Bruce
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>