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 D0B8A6B4C for ; Fri, 29 Jul 2011 02:21:19 +0000 (UTC) Received: (qmail 93728 invoked by uid 500); 29 Jul 2011 02:21:19 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 93558 invoked by uid 500); 29 Jul 2011 02:21:18 -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 93549 invoked by uid 99); 29 Jul 2011 02:21:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 02:21:18 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andrew@pimlott.net designates 72.249.23.100 as permitted sender) Received: from [72.249.23.100] (HELO fugue.pimlott.net) (72.249.23.100) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 02:21:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pimlott.net; s=default; h=Content-Transfer-Encoding:Message-Id:Date:To:From:Subject:Content-Type; bh=gS6r9V3BLYiSKH4iamtWNr8oA2wMXnZbDAigzsbXkiA=; b=WzkAMhYkR7hP1inAjIfM+Zen8PqcWffCtlFj0CYBsuwxYDU6M66mwiduHbjLIKqfAzKbAVn2eLJxK60o3DQfrZ1QuYeQ4D+ESaR5Bvw71EdZFTFwSdHG5Q591bWav7yfEwBeP9f56qXKUa/bInH362LWUR84DdrOrIljjmkcxHY=; Received: from andrew by fugue.pimlott.net with local (Exim 4.72) (envelope-from ) id 1QmceZ-00011g-Oq for log4j-user@logging.apache.org; Thu, 28 Jul 2011 19:18:19 -0700 Content-Type: text/plain; charset=UTF-8 Subject: log4j doesn't trap appender exceptions From: Andrew Pimlott To: log4j-user@logging.apache.org Date: Thu, 28 Jul 2011 19:18:19 -0700 Message-Id: <1311905873-sup-1736@pimlott.net> User-Agent: Sup/git Content-Transfer-Encoding: 8bit The FAQ says, If for any reason, log4j throws an uncaught exception, please send an email to the log4j-user@logging.apache.org mailing list. Ok. log4j does not trap exceptions thrown by appenders. You can reproduce under apache-log4j-1.2.16 with this simple appender: import org.apache.log4j.*; import org.apache.log4j.spi.*; public static class MyAppender extends AppenderSkeleton { public void append(LoggingEvent e) { throw new RuntimeException("catch me!"); } public boolean requiresLayout() { return true; } public void close() { } } The exception: Exception in thread "main" java.lang.RuntimeException: catch me! at MyAppender.append(MyAppender.java:6) at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251) at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66) at org.apache.log4j.Category.callAppenders(Category.java:206) at org.apache.log4j.Category.forcedLog(Category.java:391) at org.apache.log4j.Category.warn(Category.java:1043) at Log4jTry.main(Log4jTry.java:20) log4j should catch errors from appenders. (Or, it should not call itself fail-stop. Or, it should not call itself extensible.) Andrew --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org