I guess I'm not fully understanding that - when an event arrives, the timer is reset so that it will fire in "FlushPeriod" seconds, assuming no more events arrive, or, put another way, will fire "FlushPeriod" seconds after the last event arrival. If I am not understanding how the timer works, feel free to enlighten me, I am still working toward my "guru" merit badge... :)
Peter From: Dominik Psenner [mailto:dpsen...@gmail.com] Sent: Friday, October 18, 2013 9:06 AM To: 'Log4NET Dev' Subject: AW: Remote appender not sending *hm* .. I see .. but changing the timer whenever an event arrives effectively makes the timer useless. Glad you were able to solve this. Cheers Von: Howe, Peter L [mailto:ph...@paychex.com] Gesendet: Freitag, 18. Oktober 2013 14:33 An: Log4NET Dev Betreff: RE: Remote appender not sending Since timer.Change( ) is called every time an event is added, I think it is not the timer. I made a change elsewhere in my code, changing this: RemotingConfiguration.Configure(null, true); To this: RemotingConfiguration.Configure(null, false); Data started flowing when I turned off the security on both ends. I don't know if I will be able to keep it this way, but any machine on which this is done will be behind the firewall, so hopefully I won't have to figure out all the security stuff for remoting. Peter From: Dominik Psenner [mailto:dpsen...@gmail.com] Sent: Friday, October 18, 2013 2:26 AM To: 'Log4NET Dev' Subject: AW: Remote appender not sending 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 If period is zero (0) or Infinite<http://msdn.microsoft.com/en-us/library/system.threading.timeout.infinite.aspx>, 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 Change<http://msdn.microsoft.com/en-us/library/system.threading.timer.change.aspx> and specifying a positive value for period. Von: Dominik Psenner [mailto:dpsen...@gmail.com] 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:ph...@paychex.com] 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.