Hi,
would be nice if the BufferingForwardingAppender could be configured to flush
during idle times. So how about adding:
private int m_flushOnIdle;
private DateTime m_lastAppendTime=DateTime.Now;
virtual public int FlushOnIdle
{
get { return m_flushOnIdle; }
set
{
m_flushOnIdle = value;
if (m_flushOnIdle==0) return;
new Thread(() =>
{
while (m_flushOnIdle>0) {
Thread.Sleep(m_flushOnIdle/2);
if (DateTime.Now - m_lastAppendTime > new TimeSpan(0,
0, 0, 0, m_flushOnIdle))
Flush();
}
}){IsBackground = true}.Start();
}
}
And:
override protected void Append(LoggingEvent loggingEvent)
{
m_lastAppendTime = DateTime.Now;
........
Regards,
Günter