Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 78047 invoked from network); 3 Feb 2006 16:12:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Feb 2006 16:12:33 -0000 Received: (qmail 84734 invoked by uid 500); 3 Feb 2006 16:12:32 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 84709 invoked by uid 500); 3 Feb 2006 16:12:31 -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 84698 invoked by uid 99); 3 Feb 2006 16:12:31 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2006 08:12:31 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [64.14.54.239] (HELO ext-nj2ut-9.online-age.net) (64.14.54.239) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2006 08:12:29 -0800 Received: from int-nj2ut-4.online-age.net (int-nj2ut-4.online-age.net [3.159.237.73]) by ext-nj2ut-9.online-age.net (8.13.5/8.13.5/20051114-SVVS-TLS-DNSBL) with ESMTP id k13GC4Gw003920 for ; Fri, 3 Feb 2006 11:12:05 -0500 Received: from cinmlef10.e2k.ad.ge.com (localhost.localdomain [127.0.0.1]) by int-nj2ut-4.online-age.net (8.11.6/8.11.6/20050510-SVVS) with ESMTP id k13GC3P25877 for ; Fri, 3 Feb 2006 11:12:03 -0500 Received: from CINMLVEM17.e2k.ad.ge.com ([3.159.215.36]) by cinmlef10.e2k.ad.ge.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 3 Feb 2006 11:12:02 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C628DC.9194A090" Subject: RE: Database Appender Date: Fri, 3 Feb 2006 11:12:02 -0500 Message-ID: <1A1D177ED885934DB6D62FFB199BFA4C09EE0F@CINMLVEM17.e2k.ad.ge.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Database Appender Thread-Index: AcYoDvMcx+Au8TthTPK9rzTg5GyNpgAAPv9gADBH44AAAoZXAAAAUahg From: "Bejugam, Raghavendra \(GE Commercial Finance, NonGE\)" To: "Log4NET User" X-OriginalArrivalTime: 03 Feb 2006 16:12:02.0988 (UTC) FILETIME=[91C0B6C0:01C628DC] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C628DC.9194A090 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thanks Georg so the below code should work right? =20 override protected void SendBuffer(LoggingEvent[] events) { if (m_reconnectOnError && (m_dbConnection =3D=3D null || m_dbConnection.State !=3D ConnectionState.Open)) { LogLog.Debug("AdoNetAppender: Attempting to reconnect to database. Current Connection State: " + = ((m_dbConnection=3D=3Dnull)?"":m_dbConnection.State.ToString()) ); InitializeDatabaseConnection(); InitializeDatabaseCommand(); } =20 Thanks & regards, Raghu -----Original Message----- From: Georg Jansen [mailto:Georg.Jansen@FaktNet.com] Sent: Friday, February 03, 2006 11:07 AM To: 'Log4NET User' Subject: RE: Database Appender Raghu, =20 You set the parameter in the AdoNetAppender, like: =20 =20 +++ other AdoNetAppender parameters =20 =20 But like I mentioned in my previous post, I couldn't see that it had any = impact (at least not from the tests I did), that's way I wrote the new = version of the SendBuffer method. =20 Regards Georg http://www.l4ndash.com Log4Net Dashboard / = Log4Net Viewer=20 =20 =20 =20 =20 =20 _____ =20 From: Bejugam, Raghavendra (GE Commercial Finance, NonGE) = [mailto:raghavendra.bejugam@ge.com]=20 Sent: 3. februar 2006 15:51 To: Log4NET User Subject: RE: Database Appender =20 Any idea where to set this property=20 ReconnectOnError to TRUE. If some one can provide me the sample syntax = of config file it would help. Thanks, Raghu =20 -----Original Message----- From: Georg Jansen [mailto:Georg.Jansen@FaktNet.com] Sent: Thursday, February 02, 2006 11:22 AM To: 'Log4NET User' Subject: RE: Database Appender =20 Simon, =20 I believe it was done some work on that in 1.2.9 (you are using an = earlier version, right?) =20 I checked the source code for the AdoNetAppender, and in the SendBuffer = it tries to do a reconnect (if the parameter reconnectonerror is stated = in the config). =20 override protected void SendBuffer(LoggingEvent[] events) { if (m_reconnectOnError && (m_dbConnection =3D=3D null || m_dbConnection.State !=3D ConnectionState.Open)) { LogLog.Debug("AdoNetAppender: Attempting to reconnect to database. Current Connection State: " + = ((m_dbConnection=3D=3Dnull)?"":m_dbConnection.State.ToString()) ); InitializeDatabaseConnection(); InitializeDatabaseCommand(); } =20 =20 Problem is that when I tested this (I restarted SQL server between two = log statements), I still gets an exception stating a "transport layer = error". =20 I agree with you, Simon this is a problem with applications running for = a long time for example web applications. A simple solution would be to = modify the adonetappender and try to do a reconnect whenever the sql = statement fails (I will give it a try). =20 =20 Regards Georg http://www.l4ndash.com Log4Net Dashboard / = Log4Net Viewer=20 =20 =20 -----Original Message----- From: Simon Wallis [mailto:mailing@wallis.ca]=20 Sent: 2. februar 2006 16:31 To: Log4NET User Subject: RE: Database Appender =20 Hi, =20 Has anyone come up with any creative ways to solve this problem of the = database connection hanging? The only thing I can think of is to have a = process that "touches" the config file on an hourly basis. Otherwise we = have to remember to go around doing this manually on all the servers = whenever the database is rebooted or there's a temporary network = failure. =20 I realize it would be a lot of work to add retry or failure semantics to = the appender, but whenever this is implemented, likely the most flexible = approach would be to provide a number of options via the config file. =20 Simon. =20 =20 -----Original Message----- Subject: RE: Database Appender From: "Nicko Cadell" Date: 2005-01-10 13:59:27 Message-ID: DDEB64C8619AC64DBC074208B046611C59C838 () kronos ! neoworks = ! co ! uk [Download message RAW] =20 Greg, =20 The AdoNetAppender does not reopen the connection if there is a failure. The database connection is only opened during appender initialisation. Error handling is a general issue for appenders but for the AdoNetAppender there are a number of options.=20 =20 The current behaviour is for the appender to stop trying to write to the database if the connection is closed. An alternative is for the appender to try to reconnect to the database. The issues with reconnecting is when to try and how many times. The appender could try to reconnect when the buffered events are sent. If it fails to contact the server then the connection will time out after some time. This is a synchronous call and therefore any logging call in your application could randomly incur this connection timeout penalty at any time. Is that acceptable behaviour for the appender? If the appender cannot reconnect should it discard the events that it cannot deliver? or should it store the events and redeliver them when/if it does reconnect, if so how many event should it store? =20 There are no easy solutions to these issues, and different behaviours will be appropriate for different situations. The current AdoNetAppender implementation does not attempt to support any retry or failure semantics. This is one area where we will need to do some work in future. If you have any suggestions we would be happy to discuss them.=20 =20 Nicko =20 > -----Original Message----- > From: Ismay, Greg (CALBRIS)=20 > [mailto:Greg.Ismay@comalco.riotinto.com.au]=20 > Sent: 10 January 2005 04:15 > To: log4net-user@logging.apache.org > Subject: Database Appender >=20 >=20 > > howdy everyone... > >=20 > > im using the database ADONetAppender to log to a sql server=20 > database and its all going peachy keen... for a while... > >=20 > > ive got the same app installed at 4 of our sites, with the=20 > appender pointing back to a central database accessible over=20 > the wan (i will probably end up using a local db at each=20 > site, but a central db was my going in position, with a "lets=20 > see how it goes before we decentralise" mentality). the wans=20 > pretty fast and im only doing production logging (ie only=20 > errors and fatals) this way. > >=20 > > basically, it works for a few days and sometimes up to a=20 > week or so, before the logging just stops. > >=20 > > forcing the loggers to reinitialised (ie by "touch"ing the=20 > log4net.config file) makes it all good again... > >=20 > > my question is this... are there any known problems with the db=20 > > appender (or any appender) whereby a loss of connection (which can=20 > > happen over the wan) over time could result in the above=20 > state (eg...=20 > > maybe running out of connections in the pool due to them gradually=20 > > getting "stuck") > >=20 > > ill troll through the code in a few minutes, but just=20 > thought id ask first. > >=20 > > thanks, > >=20 > > Greg Ismay > >=20 > > Specialist - Database Support (Automation Improvement) Comalco=20 > > Aluminium Limited > >=20 > > Phone : +61 7 3867 1853 > > Fax : +61 7 3867 1855 > > Mobile : +61 4 1760 6429 > > >=20 ------_=_NextPart_001_01C628DC.9194A090 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Thanks=20 Georg so the below code should work right?
 

override protected void = SendBuffer(LoggingEvent[]=20 events)

{

   if (m_reconnectOnError && = (m_dbConnection =3D=3D null ||

     =20            =20  m_dbConnection.State !=3D=20 ConnectionState.Open))

   {

     =20 LogLog.Debug("AdoNetAppender: Attempting to reconnect to=20 database.

  =20             &= nbsp;  Current = Connection State: " = +

     =20 ((m_dbConnection=3D=3Dnull)?"<null>":m_dbConnection.State.ToString(= ))=20 );

     =20 InitializeDatabaseConnection();

     =20 InitializeDatabaseCommand();

   }

 

Thanks = &=20 regards,

Raghu

-----Original Message-----
From: Georg Jansen=20 [mailto:Georg.Jansen@FaktNet.com]
Sent: Friday, February 03, = 2006=20 11:07 AM
To: 'Log4NET User'
Subject: RE: Database=20 Appender

Raghu,

 

You set the = parameter=20 in the AdoNetAppender, like:

 

<appender=20 name=3D"AdoNetAppender" type=3D"log4net.Appender.AdoNetAppender">      =20

  =20 <reconnectonerror=20 value=3D"true" = />

  =20 +++ other AdoNetAppender parameters

     =20

 

But like = I=20 mentioned in my previous post, I couldn’t see that it had any = impact (at least=20 not from the tests I did), that’s way I wrote the new version of = the=20 SendBuffer method.

 

Regards

Georg

http://www.l4ndash.com = Log4Net Dashboard=20 / Log4Net Viewer

 

 

 

 

 


From:=20 Bejugam, Raghavendra (GE Commercial Finance, NonGE)=20 [mailto:raghavendra.bejugam@ge.com]
Sent:
3. februar 2006 = 15:51
To: Log4NET=20 User
Subject: RE: Database=20 Appender

 

Any idea = where to set=20 this property

ReconnectOnError to=20 TRUE. If some one can provide me the sample syntax of config file it = would=20 help.

Thanks,

Raghu

 

-----Original=20 Message-----
From:
Georg Jansen=20 [mailto:Georg.Jansen@FaktNet.com]
Sent: Thursday, February 02, = 2006 11:22=20 AM
To: = 'Log4NET User'
Subject: RE: Database=20 Appender

 

Simon,

 

I believe it was = done some=20 work on that in 1.2.9 (you are using an earlier version,=20 right?)

 

I checked the source = code for=20 the AdoNetAppender, and in the SendBuffer it tries to do a reconnect = (if the=20 parameter reconnectonerror is stated in the=20 config).

 

override protected void = SendBuffer(LoggingEvent[]=20 events)

{

   if (m_reconnectOnError = &&=20 (m_dbConnection =3D=3D null ||

     =20            =20  m_dbConnection.State !=3D=20 ConnectionState.Open))

   = {

     =20 LogLog.Debug("AdoNetAppender: Attempting to reconnect to=20 database.

  =20 =             &= nbsp;  Current = Connection State: "=20 +

     =20 = ((m_dbConnection=3D=3Dnull)?"<null>":m_dbConnection.State.ToString(= ))=20 );

     =20 InitializeDatabaseConnection();

     =20 InitializeDatabaseCommand();

   = }

 

 

Problem is that when = I tested=20 this (I restarted SQL server between two log statements), I still = gets an=20 exception stating a “transport layer = error”.

 

I agree with you, = Simon this=20 is a problem with applications running for a long time for example = web=20 applications. A simple solution would be to modify the = adonetappender and=20 try to do a reconnect whenever the sql statement fails (I will give = it a=20 try).

 

 

Regards

Georg

http://www.l4ndash.com Log4Net = Dashboard /=20 Log4Net Viewer

 

 

-----Original Message-----
From: Simon Wallis=20 [mailto:mailing@wallis.ca]
Sent: 2. februar 2006 16:31
To:=20 Log4NET = User
Subject: RE:=20 Database Appender

 

Hi,

 

Has anyone come up with any creative ways = to solve=20 this problem of the database connection hanging? The only thing I = can think=20 of is to have a process = that=20 "touches" the config file on an hourly basis. Otherwise we have to = remember=20 to go around doing this manually on all the servers whenever the = database is=20 rebooted or there's a temporary network=20 failure.

 

I realize it would be a lot of work to add = retry or=20 failure semantics to the appender, but whenever this is implemented, = likely=20 the most flexible approach would be to provide a number of options = via the=20 config file.

 

Simon.

 

 

-----Original Message-----

Subject:    RE:  = Database=20 Appender

From:       = "Nicko=20 Cadell" <nicko () neoworks ! com>

Date:       = 2005-01-10=20 13:59:27

Message-ID: = DDEB64C8619AC64DBC074208B046611C59C838=20 () kronos ! neoworks ! co ! uk<= /P>

[Download message RAW]

 

Greg,

 

The AdoNetAppender does not reopen the = connection if=20 there is a failure.

The database connection is only opened = during=20 appender initialisation.

Error handling is a general = issue for appenders but for=20 the

AdoNetAppender there are a number of = options.=20

 

The current behaviour is for the appender = to stop=20 trying to write to the

database if the connection is closed. An = alternative=20 is for the appender

to try to reconnect to the database. The=20 issues with = reconnecting=20 is

when to try and how many times. The = appender could=20 try to reconnect when

the buffered events are sent. If it fails = to contact=20 the server then the

connection will time out after some time. = This is a=20 synchronous call and

therefore any logging call in your = application could=20 randomly incur this

connection timeout penalty at any time. Is = that=20 acceptable behaviour for

the appender? If the appender cannot = reconnect=20 should it discard the

events that it cannot deliver? or should = it store=20 the events and

redeliver them when/if it does reconnect, = if so how=20 many event should it

store?

 

There are no easy solutions to these=20 issues, and different=20 behaviours

will be appropriate for different = situations. The=20 current AdoNetAppender

implementation does not attempt to support = any retry=20 or failure

semantics. This is one area where we will = need to do=20 some work in

future. If you have any suggestions we = would be=20 happy to discuss them.=20

 

Nicko

 

> -----Original Message-----

> From: Ismay, Greg (CALBRIS)=20

> = [mailto:Greg.Ismay@comalco.riotinto.com.au]=20

> Sent: 10 January 2005=20 04:15

> To:=20 log4net-user@logging.apache.org

> Subject: Database=20 Appender

>

>

> > howdy=20 everyone...

> >

> > im using the database = ADONetAppender to=20 log to a sql server

> database and its all going peachy = keen... for a=20 while...

> >

> > ive got the same app installed = at 4 of our=20 sites, with the

> appender pointing back to a central = database=20 accessible over=20

> the wan (i will probably end up using = a local=20 db at each

> site, but a central db was my going = in=20 position, with a "lets

> see how it goes before we = decentralise"=20 mentality). the wans

> pretty fast and im only doing = production=20 logging (ie only

> errors and fatals) this=20 way.

> >

> > basically, it works for a few = days and=20 sometimes up to a

> week or so, before the logging just=20 stops.

> >

> > forcing the loggers to = reinitialised (ie=20 by "touch"ing the

> log4net.config file) makes it all = good=20 again...

> >

> > my question is this... are there = any known=20 problems with the db

> > appender (or any appender) = whereby a=20 loss of connection = (which can=20

> > happen over the wan) over time = could=20 result in the above

> state (eg... =

> > maybe running out of connections = in the=20 pool due to them gradually

> > getting=20 "stuck")

> >

> > ill troll through the code in a = few=20 minutes, but just

> thought id ask=20 first.

> >

> > = thanks,

> >

> > Greg = Ismay

> >

> > Specialist - Database Support = (Automation=20 Improvement) Comalco

> > Aluminium=20 Limited

> >

> > Phone   :   +61 7 = 3867=20 1853

> > Fax    = :   +61 7=20 3867 1855

> > Mobile  :   +61 4 = 1760=20 6429

> >

>=20

------_=_NextPart_001_01C628DC.9194A090--