Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-267

Added overload to RemoteLoggingServerPlugin to allow callers to pass in an additional logger to use if the number of errors goes over a specified threshold

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.2.10
    • Other
    • None
    • N/A (compiled against .NET 2.0)

    Description

      I had a requirement for my project that the ops team be notified every time the number of error-level or higher alerts logged system-wide was more than a certain threshold in any given day. (i.e. notify ops after every 25 errors, but reset the count every day, so there might be multiple notifications on a single day if the error log were getting flooded, but a few errors per day will not raise the alarm.) I think this might be of use for other people's projects as well, so I thought I would contribute the code. To use it, the service calling the remote sink would pass in a named logger and a threshold to an overloaded constructor. If no logger is passed in to the constructor, the plugin will use its original behavior with no performance implication beyond one check for null.

      Please see attached code.

      Attachments

        1. RemoteLoggingServerPlugin.cs
          12 kB
          Julie Sheffield

        Activity

          People

            Unassigned Unassigned
            codegrll Julie Sheffield
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: