logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bender Heri" <HBen...@Ergonomics.ch>
Subject RE: Generating SNMP traps from Java Application
Date Mon, 13 Feb 2006 09:30:48 GMT
Hi

You configure in the xml file a separate logger with the appropriate SNMP appender and name
it i.e. like "MySNMPLogger".

In the java code you instatiate this logger like this:

Logger mySNMPLogger = Logger.getLogger( "MySNMPLogger" ). 

This instance is then used for the SNMP traps, other instances are used for normal logging.

Heri

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Swarna Mani
> Sent: Monday, February 13, 2006 3:34 AM
> To: log4j-user@logging.apache.org
> Subject: Generating SNMP traps from Java Application
> 
> 
> My Name is Swarna. I am trying to implement generation of 
> SNMP traps from Java
> application using log4j. We already have log4j implemented 
> for generating log
> messages.
> 
> When I searched in the web, I came across posts in 
> http://blog.gmane.org Wherein
> it is explained that code like
> 
> logger.warn("Send a trap");
>  
> 
> will generate a trap.
> 
> My question is we use similar one to generate logs, how can 
> we distinguish
> between entries for logs and entries for traps?
> 
>  
> 
> Also I find that it is mentioned that all we need to do is change the
> configuration script. I am thinking of using JOESNMP.
>  
> Will it be possible for you to provide me the steps  on
> 
> What needs to be coded in java application to differentiate 
> logs and traps? 
> Where do I install joesnmp? 
> What changes I need to make to log4j.xml? 
> How can I test the same? 
>  
> 
> Thanks in Advance,
> Swarna
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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