Skip to content

jonfreeland/Log4Netly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log4Netly

Simple, asynchronous Loggly log4net appender. Find the NuGet package here.

{
  "level":"ERROR",
  "time":"2014-06-28T00:40:27.7318531-04:00",
  "machine":"MYMACHINE",
  "process":"Log4NetlyTesting.vshost",
  "thread":"10",
  "message":"Now you've done it...",
  "logger":"Log4NetlyTesting.Program",
  "customProperty":"Your very own LoggingEvent property!",
  "exception":{
    "message":"Attempted to divide by zero.",
    "stackTrace":" at Log4NetlyTesting.Program.Main(String[] args) in c:\\SomePath\\Log4Netly\\Log4NetlyTesting\\Program.cs:line 19",
    "type":"DivideByZeroException",
    "innerException": {
      "message":"Inner exception message.",
      "stackTrack":" at Log4NetlyTesting.Program.Main(String[] args) in c:\\SomePath\\Log4Netly\\Log4NetlyTesting\\Program.cs:line 18",
      "type":"Exception"
    }
  }
}

For light usage, you can use the regular appender:

<appender name="LogglyAppender" type="Log4Netly.LogglyAppender, Log4Netly">
  <endpoint value="https://logs-01.loggly.com/" />
  <token value="your-loggly-token" />
  <tags value="tag1,tag2,tag3" /><!-- One or more tags -->
</appender>

For heavy usage, to reduce the chance of TCP port exhaustion, use the buffered appender:

<appender name="BufferedLogglyAppender" type="Log4Netly.BufferedLogglyAppender, Log4Netly">
  <endpoint value="https://logs-01.loggly.com/"/>
  <token value="your-loggly-token" />
  <tags value="tag1,tag2,tag3" /><!-- One or more tags -->
  <bufferSize value="512" />
  <intervalInMs value="2500" />
</appender>

Both buffers include basic support for log4net's ErrorHandler. An example is provided in the Log4NetlyTesting project.

About

Simple, asynchronous Loggly log4net appender.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages