Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 17AFAC962 for ; Sun, 21 Jul 2013 08:24:50 +0000 (UTC) Received: (qmail 49890 invoked by uid 500); 21 Jul 2013 08:24:49 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 49695 invoked by uid 500); 21 Jul 2013 08:24:49 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 49687 invoked by uid 99); 21 Jul 2013 08:24:48 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Jul 2013 08:24:48 +0000 Date: Sun, 21 Jul 2013 08:24:48 +0000 (UTC) From: "Remko Popma (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4J2-124) Gracefully stopping LogContext using the api interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4J2-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13714666#comment-13714666 ] Remko Popma commented on LOG4J2-124: ------------------------------------ I see, you don't want this method in the LoggerContext interface, good point. How about adding a new interface to the SPI package? This interface has only one method, {{void shutdown()}}. The interface could be called, for example, IShutdown. The implementation then would look like this: {code} // LogManager public static void shutdown() { LoggerContext context = getContext(); if (context instanceof IShutdown) { ((IShutdown) context).shutdown(); } } {code} > Gracefully stopping LogContext using the api interfaces > ------------------------------------------------------- > > Key: LOG4J2-124 > URL: https://issues.apache.org/jira/browse/LOG4J2-124 > Project: Log4j 2 > Issue Type: Question > Affects Versions: 2.0-beta3 > Reporter: Szabolcs Beki > Priority: Minor > > I'm trying to gracefully close my SocketAppender before exiting the my application to avoid IOExceptions on the socket server side. > Currently I can make it only by using interface the org.apache.logging.log4j.core.Lifecycle interface in the Log4j2 core : > ((Lifecycle) LogManager.getContext()).stop(); > I would prefer to have a cleaner solution that uses solely the Log4j-api not Log4j-core. > Did I overlook something or stop() on the API side really missing ? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org