logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Madduri, Murthy" <Murthy.Madd...@fnf.com>
Subject RE: Different Log4j log file(s) based on Logging Level?
Date Fri, 11 Aug 2006 16:02:50 GMT
We have hierarchical logging in our applications.
But, this requirement is to have the logs grouped based on a custom
level.
For a typical configuration transaction, the logger can record messages
from various hierarchies. We are not guaranteed of the sequence of
messages in this whole transaction. We are pretty much getting all the
messages, but, they ended up mixing with other trace statements. 

For example, if we have a new custom log level, can we use that in
<logger> configuration like this?
	<logger name="com.logging.test">
	
		<!-- Logging level (i.e. WARN) for this logger: -->
		<level value="CONFIG" />
	
		<!-- File appender for this logger: -->
		<appender-ref ref="fileAppender" />
	</logger>
 

-----Original Message-----
From: James Stauffer [mailto:stauffer.james@gmail.com] 
Sent: Friday, August 11, 2006 11:46 AM
To: Log4J Users List
Subject: Re: Different Log4j log file(s) based on Logging Level?

Have you considered having separate logging hierarchies instead?  That
is often a better solution.

On 8/11/06, Madduri, Murthy <Murthy.Madduri@fnf.com> wrote:
> Hi,
>
>
>
> We are using log4j for our core business framework and it works fine.
>
> One of recent requirements is that we need to capture different
logging
> events: very much customized.
>
> For example, they need a Configurations event, Business Activity event
> etc.
>
>
>
> 1)       Is there a way we can extend the org.apache.log4j.Level
class?
> Can we have our own logging levels?
>
> 2)       If so, can we re-direct the different logging levels into
> different log files? For example, all the log statements with
> com.test.logging.Level.CONFIG(a custom level) should be directed to
> myapp-config.log and vice versa.
>
> 3)       In a J2EE application, how can we use a different log4j
> configuration file name, NOT the default log4j.xml or log4j.proprties?
>
>
>
> Any help is appreciated.
>
>
>
> Thanks & Regards
> Murthy Madduri
> * (770)263-1231
> * Email: murthy.madduri@fnf.com
>
>
>
>
>


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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



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


Mime
View raw message