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:[EMAIL PROTECTED] Behalf Of Swarna Mani > Sent: Monday, February 13, 2006 3:34 AM > To: [email protected] > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
