Issue Details (XML | Word | Printable)

Key: LOG4NET-11
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Nicko Cadell
Reporter: Nicko Cadell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Log4net

Add Flush command to API

Created: 01/Mar/05 08:06 AM   Updated: 30/Aug/05 07:32 AM
Return to search
Component/s: Core
Affects Version/s: 1.2.9
Fix Version/s: 1.2.10

Time Tracking:
Not Specified

Environment: From sourceforege - 764025 - Kevin Conroy - kmconroy
Issue Links:
dependent
 

Resolution Date: 30/Aug/05 07:32 AM


 Description  « Hide
While using Buffering is a wonderful way to help improve
performance, I would like the ability to programatically
tell the current ILog object to flush any buffers that
exist on the appenders that I've been logging to so that
I can get any messages that I've sent rather than
waiting for the buffer to fill up.

Thus, one might be able to do the following:

"log.Flush();"

and then any messages sent to that ILog object would
be processed.

Kevin Conroy - kmconroy

----

I vote for this one too!

dcazzulino

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Nicko Cadell added a comment - 01/Mar/05 08:07 AM
This change would potentially require us to break a number of interfaces

Göran Roseen added a comment - 11/Apr/05 06:01 PM
A workaround - call it ugly or not - would be to log a special message when you want to flush, and then have a trigger on the buffering appender(s)that looks for something specicial in that message.

Nicko Cadell added a comment - 17/Apr/05 09:53 AM
This issue may be alleviated by the addition of a programmatic API for flushing the buffer held by the BufferingAppenderSkeleton. While this is not a general solution for all appenders and all types of output buffering I am going to leave this issue open.

Nicko Cadell made changes - 17/Apr/05 09:53 AM
Field Original Value New Value
Link This issue depends upon LOG4NET-24 [ LOG4NET-24 ]
Repository Revision Date User Message
ASF #312321 Mon Aug 29 22:27:53 UTC 2005 nicko Fix for LOG4NET-11. Added a Flush(true) method that will flush the lossy buffer
Files Changed
MODIFY /logging/log4net/trunk/src/Appender/BufferingAppenderSkeleton.cs
MODIFY /logging/log4net/trunk/src/Util/CyclicBuffer.cs

Nicko Cadell added a comment - 30/Aug/05 07:32 AM
Added Flush(true) method to BufferingAppenderSkeleton. This method forces the current buffer to be flushed to the output even if the appender is in lossy mode.

To find the appender use the LogManager.GetRepository().GetAppenders() method, then for each BufferingAppenderSkeleton call Flush(true).

Nicko Cadell made changes - 30/Aug/05 07:32 AM
Assignee Nicko Cadell [ nicko ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.2.10 [ 11128 ]