IMHO here be dragons:
protected override void Append(LoggingEvent loggingEvent)
{
base.Append(loggingEvent);
timer.Change(FlushPeriod * 1000, Timeout.Infinite);
}
According to:
<http://msdn.microsoft.com/en-us/library/yz1c7148.aspx>
http://msdn.microsoft.com/en-us/library/yz1c7148.aspx
If period is zero (0) or
<http://msdn.microsoft.com/en-us/library/system.threading.timeout.infinite.a
spx> Infinite, and dueTime is not Infinite, the callback method is invoked
once; the periodic behavior of the timer is disabled, but can be re-enabled
by calling
<http://msdn.microsoft.com/en-us/library/system.threading.timer.change.aspx>
Change and specifying a positive value for period.
Von: Dominik Psenner [mailto:[email protected]]
Gesendet: Freitag, 18. Oktober 2013 08:14
An: 'Log4NET Dev'
Betreff: AW: Remote appender not sending
You implemented a timed appender .. maybe you forgot to start the timer? :)
Von: Howe, Peter L [mailto:[email protected]]
Gesendet: Donnerstag, 17. Oktober 2013 17:01
An: Log4NET Dev
Betreff: RE: Remote appender not sending
I also set up my test client to call LogManager.Shutdown( ) separately from
closing the application, with pauses in between things. After calling
shutdown (and a long timeout), this message was displayed on the client:
log4net: Hierarchy: Shutdown called on Hierarchy
[log4net-default-repository]
log4net:ERROR [TimedRemotingAppender] RemotingAppender [RemotingAppender]
failed
to send all queued events before close, in OnClose.
However, all four of the previously mentioned connections remain established
until the client application itself closes, at which point those connections
disappear.
Peter
From: Howe, Peter L
Sent: Thursday, October 17, 2013 10:44 AM
To: Log4NET Dev
Subject: Remote appender not sending
Importance: High
OK, here is my situation.
I have a server process written that listens on the correct port for a
remoting connection. I see it in NETSTAT:
TCP 0.0.0.0:8085 DEV-D-21F7T:0
LISTENING 884
My test application makes a few calls to log4net. I have implemented the
TimedRemotingAppender shown in these posts:
http://apache-logging.6191.n7.nabble.com/Remote-Appender-td22810.html
As expected, nothing happens in Remoting until the timer expires. I made
four logging calls in the test client. I put a breakpoint in the
TimedRemotingAppender.Append method to make sure it gets called - it is
getting called all four times. Each time it calls base.Append. Once the
timer expires and the flush( ) method is called, Remote connections show up
in NETSTAT:
TCP 127.0.0.1:8085 DEV-D-21F7T:52589 ESTABLISHED 884
TCP 127.0.0.1:8085 DEV-D-21F7T:52590 ESTABLISHED 884
TCP 127.0.0.1:8085 DEV-D-21F7T:52591 ESTABLISHED 884
TCP 127.0.0.1:8085 DEV-D-21F7T:52592 ESTABLISHED 884
TCP 127.0.0.1:52589 DEV-D-21F7T:8085 ESTABLISHED 7268
TCP 127.0.0.1:52590 DEV-D-21F7T:8085 ESTABLISHED 7268
TCP 127.0.0.1:52591 DEV-D-21F7T:8085 ESTABLISHED 7268
TCP 127.0.0.1:52592 DEV-D-21F7T:8085 ESTABLISHED 7268
I see a separate remoting connection here for each of the four log events,
however IRemoteLoggingSink.LogEvents( ) is never called on the server.
Things are getting lost somewhere in the bowels of log4net, even though it
LOOKS like Remoting connections are being made.
Can anyone point me in the right direction as far as where to look?
Thanks,
Peter
The information contained in this message may be privileged, confidential
and protected from disclosure. If the reader of this message is not the
intended recipient, or an employee or agent responsible for delivering this
message to the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please notify
your representative immediately and delete this message from your computer.
Thank you.