Issue Details (XML | Word | Printable)

Key: LOG4NET-24
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
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

Programmatic flush of BufferingAppenderSkeleton buffer

Created: 17/Apr/05 08:41 AM   Updated: 17/Apr/05 09:53 AM
Return to search
Component/s: Appenders
Affects Version/s: 1.2.9
Fix Version/s: 1.2.10

Time Tracking:
Not Specified

Issue Links:
dependent
 

Resolution Date: 17/Apr/05 08:45 AM


 Description  « Hide
Programmatic flush of BufferingAppenderSkeleton buffer

The BufferingAppenderSkeleton holds a buffer of events which are to be delivered to the appender subclass via the SendBuffer method. This buffer currently cannot be programmatically flushed to the appender.

It should be trivial to add support for a void Flush() method to the BufferingAppenderSkeleton class.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #312270 Sat Apr 16 23:42:42 UTC 2005 nicko Fix LOG4NET-24. Programmatic flush of BufferingAppenderSkeleton buffer
Files Changed
MODIFY /logging/log4net/trunk/src/Appender/BufferingAppenderSkeleton.cs

Nicko Cadell added a comment - 17/Apr/05 08:44 AM
Using this method it should be possible to write a simple method to flush all the appenders:


private static void FlushAllAppenders()
{
  foreach(log4net.Appender.IAppender appender in log4net.LogManager.GetRepository().GetAppenders())
  {
    log4net.Appender.BufferingAppenderSkeleton buffer = appender as log4net.Appender.BufferingAppenderSkeleton;
    if (buffer != null)
    {
      buffer.Flush();
    }
  }
}

Nicko Cadell added a comment - 17/Apr/05 08:45 AM
Added public virtual void BufferingAppenderSkeleton.Flush() method.

Nicko Cadell made changes - 17/Apr/05 08:45 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
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
Link This issue is depended upon by LOG4NET-11 [ LOG4NET-11 ]