Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 54970 invoked from network); 29 Nov 2006 04:32:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Nov 2006 04:32:00 -0000 Received: (qmail 2745 invoked by uid 500); 29 Nov 2006 04:32:08 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 2053 invoked by uid 500); 29 Nov 2006 04:32:06 -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 2042 invoked by uid 99); 29 Nov 2006 04:32:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Nov 2006 20:32:06 -0800 X-ASF-Spam-Status: No, hits=4.8 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [209.191.85.131] (HELO web37212.mail.mud.yahoo.com) (209.191.85.131) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 28 Nov 2006 20:31:53 -0800 Received: (qmail 66270 invoked by uid 60001); 29 Nov 2006 04:31:32 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type; b=jV7Jmkn3vfz5Eik4VK7hzuGvkWonLJ55KrafW+mINiKt3nmQu4ZEcjvPv+t9mVq5HeZ1d5JyQXHjAlFaYz8h50XV9InuJ2Com0DDsNZFludbQnTv1N/PvWKnUQ5Mr0ReSL0YaXbTpkgrg0H6iUuW1Cwnbx/pg5jRZ9y7R1ryi6I= ; Message-ID: <20061129043132.66268.qmail@web37212.mail.mud.yahoo.com> Received: from [210.177.84.29] by web37212.mail.mud.yahoo.com via HTTP; Tue, 28 Nov 2006 20:31:32 PST Date: Tue, 28 Nov 2006 20:31:32 -0800 (PST) From: Adrian Sandor Subject: Re: Logging to multiple appenders with different levels To: Log4J Users List MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1394313324-1164774692=:65777" X-Virus-Checked: Checked by ClamAV on apache.org --0-1394313324-1164774692=:65777 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable Thanks; where can I find some documentation about filters, and examples?=0A= Do they work with 1.2.14?=0A=0A----- Original Message ----=0AFrom: James St= auffer =0ATo: Log4J Users List =0ASent: Wednesday, November 29, 2006 12:15:37 PM=0ASubject: R= e: Logging to multiple appenders with different levels=0A=0ATake a look at = using filters (must use XML config). I think that will work.=0A=0AOn 11/28= /06, Adrian Sandor wrote:=0A> Yes, I want two levels for= the same category. I don't know if it's possible, I looked at the log4j 1.= 2.14 source/javadoc and the Category class has addAppender(Appender) and se= tLevel(Level) - it looks like it doesn't support multiple levels. But to me= it seems like a natural requirement.=0A> As I already mentioned, I'm using= a log4j.properties file. Here's an example:=0A>=0A> log4j.rootCategory=3DD= EBUG, main=0A>=0A> log4j.category.java.sql=3DWARN, main=0A> log4j.category.= java.sql=3DDEBUG, db=0A>=0A> log4j.appender.main=3D...=0A> log4j.appender.d= ebug=3D...=0A>=0A> (btw, should I use "logger" rather than "category"?)=0A>= =0A> Thanks=0A> Adrian=0A>=0A> ----- Original Message ----=0A> From: James = Stauffer =0A> To: Log4J Users List =0A> Sent: Wednesday, November 29, 2006 1:06:56 AM=0A> Sub= ject: Re: Logging to multiple appenders with different levels=0A>=0A> I am = not sure that it would work to do that because you have two=0A> levels (deb= ug and warn) that you want to use for java.sql. You may be=0A> able to do = it with customer filters. Are you using .properties, .xml,=0A> or code for= config? Please provide an attempt to achieve this any=0A> maybe we can tw= eak it to work.=0A>=0A> On 11/27/06, Adrian Sandor wrote= :=0A> > Hi, I'll try to explain my problem with a simplified example:=0A> >= Let's say I have two appenders: main and db. In main I want to log everyth= ing from the application at debug level, except java.sql stuff which should= only log at warn level. In the db appender, I want to log only java.sql me= ssages at debug level (so warn or higher levels will go to both appenders).= How can I define that in my log4j.properties?=0A> >=0A> > Thanks=0A> > Adr= ian=0A=0A=0A=0A=0A=0A=0A=0A=0A =0A_________________________________________= ___________________________________________=0ADo you Yahoo!?=0AEveryone is = raving about the all-new Yahoo! Mail beta.=0Ahttp://new.mail.yahoo.com --0-1394313324-1164774692=:65777--