Skip to content

EAAppFoundry/loggly-csharp

 
 

Repository files navigation

Loggly .NET Driver

This is a .NET driver for loggly.com.

Download the bits here: Loggly.zip

Logging Events

Create a new Logger with your input key:

var logger = new Logger(“my-long-key-that-i-got-when-setting-up-my-http-input”);

Use either a synchronous or asynchronous Log method.

To Log in a structured way that allows you to reliabily capture a Log Level and the Machine Name use:

logger.Log(StructuredLogLevel.debug, “machineName”, “Log Message”);

or for Async

logger.LogAsync(StructruedLogLevel.info, “machineName”, “Log Message”);

There are 5 different Log Levels available to you. They are:
info, debug, warn, error, fatal

If you want to log in plain text (esp if your Loggly input is already setup for text only), use the Log method:

logger.log(“This is my log message”);

Searching Events

First, setup the username/password you want to connect with:

LogglyConfiguration.Configure(c => c.AuthenticateWith(“username”, “password”));

Next, create a searcher with your domain:

var searcher = new Searcher(“mydomain”);

Finally, use the various Search methods.

Note that searching happens synchronously.

Facets

First, setup the username/password you want to connect with:

LogglyConfiguration.Configure(c => c.AuthenticateWith(“username”, “password”));

Next, create a facet with your domain:

var facet = new Facet(“mydomain”);

Finally, use the various GetDate, GetIp and @GetInput* methods.

Getting facts is always synchronous

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.6%
  • Shell 1.4%