Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 16051 invoked from network); 27 Jan 2010 11:08:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2010 11:08:11 -0000 Received: (qmail 56634 invoked by uid 500); 27 Jan 2010 11:08:11 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 56568 invoked by uid 500); 27 Jan 2010 11:08:10 -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 56557 invoked by uid 99); 27 Jan 2010 11:08:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 11:08:09 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 11:08:01 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Na5kK-0002lf-II for log4j-user@logging.apache.org; Wed, 27 Jan 2010 03:07:40 -0800 Message-ID: <27336507.post@talk.nabble.com> Date: Wed, 27 Jan 2010 03:07:40 -0800 (PST) From: "S.Kannan" To: log4j-user@logging.apache.org Subject: ClassCirculatoryError MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: techy_kans@yahoo.co.in X-Virus-Checked: Checked by ClamAV on apache.org The following is our own LogManager which does not extends the LogManager of log4j public class LogManager { String className; Logger objLog; static { InputStream logProps = LogManager.class.getClassLoader() .getResourceAsStream(ABCConstants.LOGFILE); try { Properties prop = new Properties(); prop.load(logProps); PropertyConfigurator.configure(prop); } catch (Exception e) { System.out.println("error in LogManager" + e.getMessage()); } } public void logMessage(String strLevel, String Message) { if (strLevel.equals(ABCConstants.DEBUG)) { objLog.log(ABCLevel.DEBUG, Message); } else if (strLevel.equals(ABCConstants.INFO)) { objLog.log(ABCLevel.INFO, Message); } else if (strLevel.equals(ABCConstants.WARN)) { objLog.log(ABCLevel.WARN, Message); } else if (strLevel.equals(ABCConstants.ERROR)) { objLog.log(ABCLevel.ERROR, Message); } else if (strLevel.equals(ABCConstants.FATAL)) { objLog.log(ABCLevel.FATAL, Message); } else if (strLevel.equals(ABCConstants.DASH)) { objLog.log(ABCLevel.DASH, Message); } /* * Default is o log at DEBUG level */ else { objLog.log(ABCLevel.DEBUG, Message); } } } The following is the custom level import org.apache.log4j.Level; public class ABCLevel extends Level { //Defining DASH constants private static final long serialVersionUID = -750240227063564211L; public static final int DASH_INT = 60000; public static final String DASH_STRING = "DASH"; private static LogManager logMgr = new LogManager(ABCLevel.class.getName()); public static final Level DASH = new ABCLevel(DASH_INT, DASH_STRING, 0); /** * @param intValue - level * @param levelName - level Name * @param sysLogEquivalent - Equivalent sys log */ protected ABCLevel(final int intValue, final String levelName, final int sysLogEquivalent) { super(intValue, levelName, sysLogEquivalent); } /** * @param val - integer value * @return Level */ public static Level toLevel(final int val) { logMgr.logMessage(ABCConstants.INFO, "In ABCLevel,toLevel() begins val : " + val); if (val == DASH_INT) { return DASH; } logMgr.logMessage(ABCConstants.INFO,"In ABCLevel,toLevel(): ends"); return (Level) toLevel(val, Level.DEBUG); } } The following is the MyEventEvaluator public class MyEventEvaluatorimplements TriggeringEventEvaluator { @Override public boolean isTriggeringEvent(LoggingEvent event) { if (event.getLevel() == ABCLevel.DASH) return true; else return false; } } The following is the Customized SMTP Appender public class ABCSmtpAppender extends SMTPAppender { @Override public void setEvaluatorClass(String arg0) { super.setEvaluatorClass(arg0); } @Override public String getEvaluatorClass() { return super.getEvaluatorClass(); } } -- View this message in context: http://old.nabble.com/ClassCirculatoryError-tp27336507p27336507.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