Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 13763 invoked from network); 18 Jul 2004 18:08:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Jul 2004 18:08:06 -0000 Received: (qmail 26055 invoked by uid 500); 18 Jul 2004 18:08:02 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 26014 invoked by uid 500); 18 Jul 2004 18:08:02 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 26000 invoked by uid 99); 18 Jul 2004 18:08:02 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received: from [194.25.134.20] (HELO mailout08.sul.t-online.com) (194.25.134.20) by apache.org (qpsmtpd/0.27.1) with ESMTP; Sun, 18 Jul 2004 11:08:00 -0700 Received: from fwd02.aul.t-online.de by mailout08.sul.t-online.com with smtp id 1BmG4s-0005DL-01; Sun, 18 Jul 2004 20:07:58 +0200 Received: from odin (TDMfV0ZFgenewLdmpnDalm8qhzUkxsFdJSwTVuIfgduCettPQc5qo5@[217.86.12.62]) by fmrl02.sul.t-online.com with esmtp id 1BmG4m-2I22D20; Sun, 18 Jul 2004 20:07:52 +0200 Reply-To: From: "Mark Masterson" To: "LOG4J Users Mailing List" Subject: RE: Anyone using SNMPTrapAppender? Date: Sun, 18 Jul 2004 20:07:52 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-ID: TDMfV0ZFgenewLdmpnDalm8qhzUkxsFdJSwTVuIfgduCettPQc5qo5@t-dialin.net X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hey Bret, BTW... Scott's message made me take another look at your mail, and I realized that I had probably completely missed one simple (but important) point. You've got examples like this: myLog.debug("my debug message from host ;" + strHostName); ... where you seem to be trying to make sure the trap contains the local host name of the box (that the app is running on) that sent the trap. As far as the SNMPTrapAppender is concerned, you don't need to do this. The local IP address of the box sending the trap is *always* one of the fields in a trap -- that's part of the SNMP standard. Traps would be pretty useless if you didn't know who sent them! ;) You can hard-code the IP address that the appender uses in the properties file, in the "LocalIPAddress" property. However, as several people have pointed out over the years (mainly on this list), that's kind of retarded for most use cases. To make things worse, the different trap senders handle this attribute differently; if you set the property in your properties file, it will be used by the JoeSNMPTrapSender. But if you don't set it, the behavior of Joe is dependent on how name resolution is configured on the system in question -- currently, the address will be set to the name that resolves to "127.0.0.1", which is also kind of retarded. The WengsoftSNMPTrapSender always ignores the property completely, and sets the address dynamically. And the NetSnmpCommandLineTrapSender always uses exactly what you configure in the properties file, or "127.0.0.1" as a fallback, but with no name resolution. This whole mess is one of the things I plan to clean up a bit in the next version -- at the very least, I want to make it consistent across implementations. Anyway, no matter how you slice it, you don't need to be sending the address in the message of the logging event -- that's redundant. Of course, if you're also using other appenders, like a FileAppender or whatever, then maybe you need the address in the message anyway... Cheers, Mark --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org