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

override OnClose() in LogglyAppender so that it flushes all messages …

…on shutdown
  • Loading branch information
Richard Nagle
Richard Nagle committed Oct 30, 2017
commit 6820692417a3faf43c4e7b56d2f0b09781ccd211
@@ -2,6 +2,7 @@
using log4net.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using Timer = System.Timers;


@@ -110,5 +111,17 @@ private bool IsInputsMode()
{
return Config.LogMode == "inputs/";
}

protected override void OnClose()
{
if (IsBulkMode() && lstLogs.Any())
{
SendAllEvents(lstLogs.ToArray());
}

LogglyAsync.Flush();

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