Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 87395 invoked from network); 23 Aug 2008 01:25:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Aug 2008 01:25:34 -0000 Received: (qmail 84288 invoked by uid 500); 23 Aug 2008 01:25:32 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 83995 invoked by uid 500); 23 Aug 2008 01:25:32 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 82647 invoked by uid 99); 23 Aug 2008 01:25:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Aug 2008 18:25:28 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [68.142.200.114] (HELO web30501.mail.mud.yahoo.com) (68.142.200.114) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 23 Aug 2008 01:16:45 +0000 Received: (qmail 13518 invoked by uid 60001); 23 Aug 2008 01:16:00 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=xoIswtpgSj0lckoG4qP4ujqnXtOMduLV90iyMGwyrVbP2HUsFPXCZzTDu++3Gvt/dNOSTP3cxSDOEt90u6k9OdGxezRJIk3K2JUs5YmXBrPnjqpSJG6lOxYa0KviRGImDc+C2AHFjNB5gzCABQjwzZwaeTXG+mtGFwNuLAVvAFk=; X-YMail-OSG: kCVNGfcVM1m2YB7j._jqvuJBnaXtAVNlx0x1AZAWglgW468RFbtgyz63hwhkEQUspeDUGQ32H2GNNoGcoU6cYfBeXGATEvc4zEy0MN3wm62NPCpHg_HL9E4RDBjBy63Ig6zSZtdFpmLm1c_gkIHshf4- Received: from [75.179.188.181] by web30501.mail.mud.yahoo.com via HTTP; Fri, 22 Aug 2008 18:16:00 PDT X-Mailer: YahooMailRC/1042.48 YahooMailWebService/0.7.218.2 Date: Fri, 22 Aug 2008 18:16:00 -0700 (PDT) From: Ron Grabowski Subject: Re: Multiple Layouts to the same appender To: Log4NET User MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <657953.12027.qm@web30501.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org You shouldn't be using a layout on the ForwardingAppender. The ForwardingAppender always ignores that value. log4net doesn't concatenate the layout from your ForwardingAppender with the Console/RollingFileAppender. You'll have to copy the %m to the Console/RollingFileAppenders' layout. ----- Original Message ---- From: Loren Keagle To: log4net-user@logging.apache.org Sent: Friday, August 22, 2008 8:01:57 PM Subject: Multiple Layouts to the same appender I have an application that contains a subsystem with its own logging infrastructure. I can hook into this logging system to intercept the log messages, but the messages are already formatted. Rather than parse and decompose these messages, I simply used a PatternLayout to match the layout of the subsystem. However, I also need to log from my own code to the same file. This means I need to have an empty layout for the logger that's logging the subsystem messages, and a formatted layout for all the other loggers. I've tried using a ForwardingAppender, and setting a layout in there, but that layout is overridden by the layout in the FileAppender. If I leave the layout off of ForwardingAppender, I get a log4net error. It seems as though the chain of responsibility is reversed for the layouts than what it should be... Shouldn't log4net use the first layout it finds as it traces up the hierarchy, rather than the root layout? Why is the layout in my ForwardingAppender ignored? Here is my config block: