Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 86453 invoked from network); 14 Aug 2006 13:13:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Aug 2006 13:13:49 -0000 Received: (qmail 25604 invoked by uid 500); 14 Aug 2006 13:13:46 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 25578 invoked by uid 500); 14 Aug 2006 13:13:45 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 25567 invoked by uid 99); 14 Aug 2006 13:13:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Aug 2006 06:13:45 -0700 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=INFO_TLD,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Aug 2006 06:13:44 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GCcFw-0004Nt-DF for log4j-user@logging.apache.org; Mon, 14 Aug 2006 06:13:24 -0700 Message-ID: <5796385.post@talk.nabble.com> Date: Mon, 14 Aug 2006 06:13:24 -0700 (PDT) From: theMonkyBoy To: log4j-user@logging.apache.org Subject: =?UTF-8?Q?Newbie_=E2=80=93_log4j_and_syslog-ng_setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, sorry for this post, but I've been searching for a couple of days now and found nothing to help me get started via google! In our environment we currently have a cluster of J2EE servers, where each member writes to their own log file. Now we would like to also write to one consolidated log file. So it has been envisaged that each cluster member writes to their own syslog-ng deamon, who then in turn forwards messages on to a central logging server. I have a couple of problems here. Reading through the posts I have seen people are using the SyslogAppender to get log4j to write to the syslog-nd deamon. I have tried two configurations for this. and: log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender log4j.appender.SYSLOG.syslogHost=127.0.0.1 log4j.appender.SYSLOG.Facility=USER log4j.appender.SYSLOG.layout=org.apache.log4j.PatternLayout log4j.appender.SYSLOG.layout.ConversionPattern=%p: %c - %m I then try to use a very simple program to print to this appender: package com.foo.bar; import org.apache.log4j.Logger; public class LogStuff { Logger log = Logger.getLogger( LogStuff.class ); public static void main(String [] argv) { new LogStuff().doIt(); } private void doIt() { log.debug( "Hello world!" ); log.info( "Hello world!" ); log.warn( "Hello world!" ); log.error( "Hello world!" ); log.fatal( "Hello world!" ); } } When I then check the syslog-ng files I find nothing in there. So I guess there is some configuration to do on that side. So I started to hack the syslog-ng.conf file. source s_j2ee { unix-stream("/dev/log"); internal(); }; destination d_j2ee { file("/var/log/j2ee.log"); }; log { source(s_j2ee); destination(d_j2ee); }; As some of the internal syslog-ng messages are arriving in my log file I assume that some of this configuration is correct. However, as no java messages are being received I assume that I've not set up the source correctly. Through all my searched I was unable to find the source that log4j will use. Can someone point me in the right direction? Are there any good resources available that I can read? Thanks in advance for your help -- View this message in context: http://www.nabble.com/Newbie--log4j-and-syslog-ng-setup-tf2103256.html#a5796385 Sent from the Log4j - Users forum at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org