Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8BE86200BA2 for ; Sun, 16 Oct 2016 12:52:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8A6C5160AE2; Sun, 16 Oct 2016 10:52:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D2AB2160ACE for ; Sun, 16 Oct 2016 12:52:22 +0200 (CEST) Received: (qmail 23201 invoked by uid 500); 16 Oct 2016 10:52:20 -0000 Mailing-List: contact log4net-dev-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET Dev" List-Id: Delivered-To: mailing list log4net-dev@logging.apache.org Received: (qmail 23188 invoked by uid 99); 16 Oct 2016 10:52:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Oct 2016 10:52:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7705B2C4C72 for ; Sun, 16 Oct 2016 10:52:20 +0000 (UTC) Date: Sun, 16 Oct 2016 10:52:20 +0000 (UTC) From: "Stefan Bodewig (JIRA)" To: log4net-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (LOG4NET-511) API to flush appenders MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 16 Oct 2016 10:52:23 -0000 [ https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Bodewig resolved LOG4NET-511. ------------------------------------ Resolution: Fixed Fix Version/s: 2.0.6 fixed with svn revision 1765137 Many thanks [~Joe] > API to flush appenders > ---------------------- > > Key: LOG4NET-511 > URL: https://issues.apache.org/jira/browse/LOG4NET-511 > Project: Log4net > Issue Type: Wish > Components: Appenders, Core > Affects Versions: 1.2.15 > Environment: NA > Reporter: Joe > Priority: Minor > Fix For: 2.0.6 > > > I would like to see an API that flushes any appenders that have buffered data. E.g. a method LogManager.Flush(). An application might call such a method at regular intervals, e.g. on a Timer. > A naive implementation with the current log4net would iterate through appenders, looking for those that support flushing, and call the appender's flush method, e.g.: > foreach (IAppender appender in > LogManager.GetRepository().GetAppenders()) > { > BufferingAppenderSkeleton bas = appender > as BufferingAppenderSkeleton; > if (bas != null) bas.Flush(); > } > But (a) I'm not sure this is thread-safe and (b) there are potentially other appenders that may want to be able to flush data (e.g. a TextWriterAppender with ImmediateFlush = false). > The request consists of: > - Add an interface, IFlushableAppender or equivalent, with a single method Flush(). > - Implement this interface in all relevant appenders (BufferingAppenderSkeleton, TextWriterAppender, ...) > - Add a thread-safe static Flush() method to LogManager. -- This message was sent by Atlassian JIRA (v6.3.4#6332)