From log4j-user-return-24501-apmail-logging-log4j-user-archive=logging.apache.org@logging.apache.org Mon Jun 11 05:24:51 2012 Return-Path: X-Original-To: apmail-logging-log4j-user-archive@www.apache.org Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A0B009B54 for ; Mon, 11 Jun 2012 05:24:51 +0000 (UTC) Received: (qmail 15729 invoked by uid 500); 11 Jun 2012 05:24:51 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 15576 invoked by uid 500); 11 Jun 2012 05:24:51 -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 15551 invoked by uid 99); 11 Jun 2012 05:24:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2012 05:24:50 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FSL_RCVD_USER,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2012 05:24:44 +0000 Received: from telerig.nabble.com ([192.168.236.162]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Sdx71-0002he-Au for log4j-user@logging.apache.org; Sun, 10 Jun 2012 22:24:23 -0700 Message-ID: <33991200.post@talk.nabble.com> Date: Sun, 10 Jun 2012 22:24:23 -0700 (PDT) From: aggarwal To: log4j-user@logging.apache.org Subject: Re: class specific logging level In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: akansha.agg.9@gmail.com References: <33974515.post@talk.nabble.com> <33979415.post@talk.nabble.com> I think I have found the solution to my problem. This thing is working with "org.apache.log4j.rolling.RollingFileAppender" but not with "org.apache.log4j.RollingFileAppender" Thanks for helping me out. :) Douglas E Wegscheid wrote: > > root being set to ERROR will not block the Myclass DEBUG; the > more-specific Myclass logger setting overrides the root setting. > > Have you actually tried this? > > package com.pkg; > > import org.apache.log4j.Logger; > import com.other.OtherClass; > > public class MyClass { > static Logger logger = Logger.getLogger(MyClass.class); > public static void main (String[] args) { > logger.error ("MyClass error"); > logger.info ("MyClass info"); > logger.debug ("MyClass debug"); > OtherClass.doThings(); > } > } > > -- > > package com.other; > import org.apache.log4j.Logger; > > public class OtherClass { > static Logger logger = Logger.getLogger(OtherClass.class); > public static void doThings () { > logger.error ("OtherClass error"); > logger.info ("OtherClass info"); > logger.debug ("OtherClass debug"); > } > } > > -- > > > > debug="true"> > > > > > > > > > > > > > > > -- results in -- > > MyClass error > MyClass info > MyClass debug > OtherClass error > OtherClass info > > > > > > -- View this message in context: http://old.nabble.com/class-specific-logging-level-tp33974515p33991200.html Sent from the Log4j - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org