Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 65397 invoked from network); 2 Mar 2006 18:56:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Mar 2006 18:56:21 -0000 Received: (qmail 11454 invoked by uid 500); 2 Mar 2006 18:57:02 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 11371 invoked by uid 500); 2 Mar 2006 18:57:02 -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 11349 invoked by uid 99); 2 Mar 2006 18:57:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Mar 2006 10:57:02 -0800 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=INFO_TLD,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of nicko@neoworks.com designates 80.168.17.114 as permitted sender) Received: from [80.168.17.114] (HELO hermes.neoworks.co.uk) (80.168.17.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Mar 2006 10:57:00 -0800 Received: from kronos.neoworks.co.uk (kronos.neoworks.co.uk [10.0.0.132]) by hermes.neoworks.co.uk (8.13.1/8.13.1) with ESMTP id k22Ifkw5013512 for ; Thu, 2 Mar 2006 18:41:48 GMT Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Subject: RE: RollingFileAppender thread safety Date: Thu, 2 Mar 2006 18:56:35 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: RollingFileAppender thread safety Thread-Index: AcY+GueLwasfYw6FQVujM7NR6tHgawADuBnQ From: "Nicko Cadell" To: "Log4NET User" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N log4net is thread safe as it says in the FAQ.=20 How log4net implements this with regards to individual appenders is not really important. The docs for the RollingFileAppender are correct, the members of the type are not thread safe, but this is not relevant unless you want to programmatically access the appender directly from you code. During logging the appender's base class (AppenderSkeleton) ensures serialisation of appending of logging events. You do not need to add your own locking code around calls like: log.Info("message"); or LogManager.GetLogger("foo"); Cheers, Nicko > -----Original Message----- > From: just_a_w [mailto:just_a_w@yahoo.com]=20 > Sent: 02 March 2006 17:01 > To: log4net-user@logging.apache.org > Subject: RollingFileAppender thread safety >=20 > I need to use the RollingFileAppender in a multi-threaded=20 > application. The documentation is a little confusing when it=20 > comes to thread safety. The general FAQ says log4net is=20 > thread-safe, but the appender's documentation says it's not. >=20 > Does anyone have any suggestions on how to use the=20 > RollingFileAppender in a multi-threaded application? Do I=20 > need to modify and try to compile the code myself? Or should=20 > I do something drastic, like synchronize access to the logger? >=20 > Thanks. >=20 >=20 >=20 > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection=20 > around http://mail.yahoo.com=20 >=20