Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flush messages on close #12

Closed
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

add Flush() method to LogglyAsyncHandler to synchronously wait until …

…all messages are sent
  • Loading branch information
Richard Nagle
Richard Nagle committed Oct 30, 2017
commit 7143ba7ab2b318ad778ea6ff5678509408cf67b6
@@ -1,4 +1,5 @@
using System.Collections.Concurrent;
using System.Linq;
using System.Threading;

namespace log4net.loggly
@@ -52,6 +53,14 @@ public void PostMessage(string msg, ILogglyAppenderConfig config)
Queue.TryAdd(msg);
}
}

public void Flush()
{
while (IsRunning && Queue.Any())
{
Thread.SpinWait(100);
}
}
}

}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.