logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: shutdown and appender sync
Date Fri, 07 Jan 2005 13:39:12 GMT
If the AdoNetAppender buffer size is 1 then no buffering will occur and
the events will be written to the database immediately and
synchronously.

Calling Shutdown() multiple times is safe.

Nicko

> -----Original Message-----
> From: M. d'Entremont [mailto:mdent@crm3.com] 
> Sent: 06 January 2005 21:00
> To: Log4NET User
> Subject: Re: shutdown and appender sync
> 
> Thanks Nicko.
> 
> I'm calling shutdown, but seem to be getting some data loss 
> when my ADOAppender has a buffer value greater then 1. 
> I make sure to only call the shutdown once after the log.Error call.
> I'll try removing the shutdown call entirely.
> 
> Marc
> 
> Nicko Cadell wrote: 
> 
> 	Yes the AdoNetAppender will write buffered events to 
> the database during
> 	Shutdown.
> 	
> 	When the log4net Shutdown method is called all the 
> appenders are asked
> 	to Close.
> 	The Appenders based on the BufferingAppenderSkeleton, 
> including the
> 	AdoNetAppender, will attempt to flush their buffers to 
> their backing
> 	store.
> 	
> 	Log4net does register for the ProcessExit event and 
> will call Shutdown
> 	when the application is exiting, however the runtime 
> does not wait for
> 	the event handler to complete which may cause data loss.
> 	To ensure that the buffered events are delivered you 
> should call the
> 	LogManager.Shutdown() method explicitly during your application
> 	shutdown.
> 	
> 	Nicko
> 	
> 	  
> 
> 		-----Original Message-----
> 		From: M. d'Entremont [mailto:mdent@crm3.com] 
> 		Sent: 05 January 2005 23:12
> 		To: Log4NET User
> 		Subject: shutdown and appender sync
> 		
> 		Am I correct in assuming shutdown asks all the 
> appenders to 
> 		sync with the data repositories, i.e. in the 
> ADONetAppender I 
> 		have the buffer size set to 50. If there are 
> any messages to 
> 		be log that are not yet written to the db the 
> appender be 
> 		asked to write them?
> 		
> 		Marc
> 		
> 		
> 		    
> 
> 
> -- 
> 
> Marc d'Entremont	 Ph: (250) 386-4266	 
> Convergent Media Network	 Fax: (250) 386-4267	 
> 210-19 Dallas Rd.	 Mobile: (250) 886-8665	 
> Victoria, BC	 mdent@crm3.com	 
> V8V 5A6	 
> 
> 
>           
> 
> This electronic message transmission, including any attached 
> files, contains information which may be confidential and/or 
> privileged. The information is intended to be for the SOLE 
> use of the individual or entity named above. If you are not 
> the intended recipient, be aware that any review, disclosure, 
> copying, distribution or use of the contents of this 
> information is prohibited.  This message is not to be 
> forwarded for any reason without prior consent of the sender.
> 
> If you have received this electronic transmission in error, 
> please notify the sender immediately by telephone (250) 
> 386-4266 or by a "reply to sender only" message and destroy 
> all electronic and hard copies of the communication, 
> including attachments, without reading or saving in any manner.
> 
> 

Mime
View raw message