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 263FA200BC1 for ; Tue, 1 Nov 2016 14:32:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 244F3160AE5; Tue, 1 Nov 2016 13:32:45 +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 24CFF160AF7 for ; Tue, 1 Nov 2016 14:32:43 +0100 (CET) Received: (qmail 58985 invoked by uid 500); 1 Nov 2016 13:32:43 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 58975 invoked by uid 99); 1 Nov 2016 13:32:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2016 13:32:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 81DBDCB94C for ; Tue, 1 Nov 2016 13:32:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.88 X-Spam-Level: * X-Spam-Status: No, score=1.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=msn.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id JFFhdds97m7W for ; Tue, 1 Nov 2016 13:32:40 +0000 (UTC) Received: from BAY004-OMC3S26.hotmail.com (bay004-omc3s26.hotmail.com [65.54.190.164]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C8AFD5FBC2 for ; Tue, 1 Nov 2016 13:32:39 +0000 (UTC) Received: from NAM04-BN3-obe.outbound.protection.outlook.com ([65.54.190.188]) by BAY004-OMC3S26.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Tue, 1 Nov 2016 06:32:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=msn.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=9f249axVcILpDOfDAM0YB0nR4Xv5opYCoKZYVRTzXlc=; b=n5yzpehJR1+cRMvx2j5z5fT5d8MpneWIn4II6ji+GbtDN+Zn6em6HV6n02lU64mYzVlDRCIvOlQuPCk4t160J/ss5QIyZL+6I7wkVQlSMlTB1ZuGfeSqQNnKA/kW5MzIy3IuYxBNPSGu0Q/7wBIg//XoNV9EYruFYamHoQIuPVxr14H8jYUWrPkyPtF6Qv7Lm8DV2fse2Bugx7OYjs+m/8K6/ynxcZhY9/ztQcAMNRjVd3puT05CX48euExav7Qlc7+HtQYHX+tk1kc8e1rQOHvq4UR3QL9EeARoL27qCBczP4d3j4I1XRiN1l1RVg6s9Qvy8VycrcO/bnxxJWkccA== Received: from BN3NAM04FT064.eop-NAM04.prod.protection.outlook.com (10.152.92.57) by BN3NAM04HT172.eop-NAM04.prod.protection.outlook.com (10.152.93.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.6; Tue, 1 Nov 2016 13:32:01 +0000 Received: from BLUPR10MB0833.namprd10.prod.outlook.com (10.152.92.57) by BN3NAM04FT064.mail.protection.outlook.com (10.152.93.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.6 via Frontend Transport; Tue, 1 Nov 2016 13:32:01 +0000 Received: from BLUPR10MB0833.namprd10.prod.outlook.com ([10.163.216.11]) by BLUPR10MB0833.namprd10.prod.outlook.com ([10.163.216.11]) with mapi id 15.01.0693.009; Tue, 1 Nov 2016 13:32:01 +0000 From: Nicholas Duane To: Log4NET User Subject: Re: AsyncAppender (was Re: Apache log4net Needs Help) Thread-Topic: AsyncAppender (was Re: Apache log4net Needs Help) Thread-Index: AQHSJ6EBt/q+SssOUUyos+xXNDtmO6DENc9o Date: Tue, 1 Nov 2016 13:32:01 +0000 Message-ID: References: <871t0x1xb0.fsf@v45346.1blu.de> <87twdjayob.fsf@v45346.1blu.de> <87int8oigo.fsf@v45346.1blu.de> <87k2docioq.fsf@v45346.1blu.de> ,<87oa2ky1f0.fsf_-_@v45346.1blu.de> In-Reply-To: <87oa2ky1f0.fsf_-_@v45346.1blu.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: logging.apache.org; dkim=none (message not signed) header.d=none;logging.apache.org; dmarc=none action=none header.from=msn.com; x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [6vO1sQ0BNROk3GoxO+n88xbWPYg7lrhw] x-eopattributedmessage: 0 x-microsoft-exchange-diagnostics: 1;BN3NAM04HT172;5:xOqveyxg1uQA2RL2FSAkLonv7jDH6IQY2aTrDZca0SZsr+Dn3Nzq/cxzejwuKdbJiMochqHYgNkrfD9ZmjRTffQPWuWNNAC+TGYSUB1/rLNt/JUOFzgmBknW3kY+FRahf1Dgl0ISLwwTy4e7PRUBtw==;24:1qypHiUf3yPr4r1oCZGd5ZyxYzBEiKfyEBeoASNhSMWFq8NWhvHCcXz6Ogq+O/QZLKQlIAYuxvq/41FjpodXh5Kt0vFMSQ6zji4HIAJbumY=;7:hUYJ5qNxV/F0g8koDhQVcHG3fIZWbn856dc1BB/z9C9vbqzQojy1G1p0vlWEqS9zY7cpM+EDBuO7OTWI/GJjbyv8c4vYPWHI196kONh1ew8gEecNEuVRd+rjTclsV63rb6uGFfI0zNJaXRx24anRb2bHp7MOgEYe/IhCstsmu6JYcD1VKyGFdxpff/7HGHJVylAfl7L7vkkl363LoL/m9yV5Fl63KadyDBnCgl/bZzJh+zbhvmQh74IWy6xew+JPdnieSN9xqBZRGgl+Whq2TTG2HiEQmEnxuypWqYiL+tSLYqekepgQfjpxSp3QksqxaXYh2n9zvPfcYGXE3fubRMJR+hPFuc9M7dabYIOCPEo= x-forefront-antispam-report: EFV:NLI;SFV:NSPM;SFS:(10019020)(98900003);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3NAM04HT172;H:BLUPR10MB0833.namprd10.prod.outlook.com;FPR:;SPF:None;LANG:en; x-ms-office365-filtering-correlation-id: 05f7807a-53c9-4e8e-9201-08d4025b7603 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(1601124038)(1603103081)(1603101340)(1601125047);SRVR:BN3NAM04HT172; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(432015012)(82015046);SRVR:BN3NAM04HT172;BCL:0;PCL:0;RULEID:;SRVR:BN3NAM04HT172; x-forefront-prvs: 01136D2D90 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_BLUPR10MB0833D4DC4B52DE3C3494E9E4DBA10BLUPR10MB0833namp_" MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2016 13:32:01.0066 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3NAM04HT172 X-OriginalArrivalTime: 01 Nov 2016 13:32:12.0869 (UTC) FILETIME=[5A8BAF50:01D23444] archived-at: Tue, 01 Nov 2016 13:32:45 -0000 --_000_BLUPR10MB0833D4DC4B52DE3C3494E9E4DBA10BLUPR10MB0833namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Got some questions around this. I was hoping that if I put the call to Log= Manager.Shutdown() in my application it might call Close() on all the appen= ders. However, that doesn't seem to be the case. Not sure if the Flush() = you talk about is something that might have solved my problem. I checked over the links you provided. One talks about implementing a queu= e in an async appender so that each developer wouldn't have to do it. Whil= e that certainly sounds like a good thing to do, even this implementation w= ould need to flush its queue, or at least do as much as it could in the tim= e allotted, when the process shuts down. That is the main point I'm trying= to bring up as my appender has its own queue but the Close() method doesn'= t give me any significant amount of time to flush my queue and thus I'm los= ing events. One of the links also provides an AsyncAppender implementation which the au= thor claims will address the problem of lost events on shutdown, but it app= ears to use the Close() method to shutdown cleanly, which I would assume su= ffers from the same problem I experienced. Namely, the Close() method appe= ars to be called from log4net by way of syncing the .NET app domain shutdow= n event. At that point you're not given any time to cleanup. Thanks, Nick ________________________________ From: Stefan Bodewig Sent: Sunday, October 16, 2016 7:32 AM To: Log4NET User Subject: AsyncAppender (was Re: Apache log4net Needs Help) On 2016-10-16, Nicholas Duane wrote: > By the way, what's the state of async appenders in log4net? This is one of the things I'd love people to get involved in. We've got * a simple implementation inside the sample * https://issues.apache.org/jira/browse/LOG4NET-190 * https://issues.apache.org/jira/browse/LOG4NET-201 * https://issues.apache.org/jira/browse/LOG4NET-407 the later even made it into the 1.3 branch (that's now been abandoned). It would be good if anybody found the time to make it work inside the current trunk setup. So there are few implementations. They may share the problem mentioned here > http://stackoverflow.com/questions/36344822/log4net-appenders-onclose-doe= snt-seem-to-work I haven't checked. > Seems like log4net should not only expose a startup routine the app > must call but also a shutdown routine, and indicate that it's > essential it gets called. Then log4net could shutdown the appenders > in the shutdown routine as opposed to relying on .NET's appdomain > shutdown logic. There are Shutdown methods in LogManager and LoggerManager. The patch Joe mentions that add Flush to certain appenders and to LogManager has been added to svn trunk and will be part of 2.0.6 (which will be the version of the next release). Stefan --_000_BLUPR10MB0833D4DC4B52DE3C3494E9E4DBA10BLUPR10MB0833namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Got some questions around this.  I was hoping that if I put the cal= l to LogManager.Shutdown() in my application it might call Close() on all t= he appenders.  However, that doesn't seem to be the case.  Not su= re if the Flush() you talk about is something that might have solved my problem.


I checked over the links you provided.  One talks about implementin= g a queue in an async appender so that each developer wouldn't have to do i= t.  While that certainly sounds like a good thing to do, even this imp= lementation would need to flush its queue, or at least do as much as it could in the time allotted, when the process = shuts down.  That is the main point I'm trying to bring up as my appen= der has its own queue but the Close() method doesn't give me any significan= t amount of time to flush my queue and thus I'm losing events.


One of the links also provides an AsyncAppender implementation which the= author claims will address the problem of lost events on shutdown, but it = appears to use the Close() method to shutdown cleanly, which I would assume= suffers from the same problem I experienced.  Namely, the Close() method appears to be called from lo= g4net by way of syncing the .NET app domain shutdown event.  At that p= oint you're not given any time to cleanup.


Thanks,

Nick



From: Stefan Bodewig <= bodewig@apache.org>
Sent: Sunday, October 16, 2016 7:32 AM
To: Log4NET User
Subject: AsyncAppender (was Re: Apache log4net Needs Help)
 
On 2016-10-16, Nicholas Duane wrote:

> By the way, what's the state of async appenders in log4net?

This is one of the things I'd love people to get involved in. We've got

* a simple implementation inside the sample
* https://issues.apache.org/jira/browse/LOG4NET-190
* https://issues.apache.org/jira/browse/LOG4NET-201
* https://issues.apache.org/jira/browse/LOG4NET-407

the later even made it into the 1.3 branch (that's now been
abandoned). It would be good if anybody found the time to make it work
inside the current trunk setup.

So there are few implementations. They may share the problem mentioned
here

> http://stackoverflow.com/questions/36344822/log4net-appenders-onclose-doesn= t-seem-to-work

I haven't checked.

> Seems like log4net should not only expose a startup routine the app > must call but also a shutdown routine, and indicate that it's
> essential it gets called.  Then log4net could shutdown the append= ers
> in the shutdown routine as opposed to relying on .NET's appdomain
> shutdown logic.

There are Shutdown methods in LogManager and LoggerManager.

The patch Joe mentions that add Flush to certain appenders and to
LogManager has been added to svn trunk and will be part of 2.0.6 (which
will be the version of the next release).

Stefan
--_000_BLUPR10MB0833D4DC4B52DE3C3494E9E4DBA10BLUPR10MB0833namp_--