Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A .NET driver for loggly.com

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 loggly-csharp.tests
Octocat-spinner-32 loggly-csharp
Octocat-spinner-32 packages
Octocat-spinner-32 .gitignore
Octocat-spinner-32 license.txt
Octocat-spinner-32 loggly-csharp.sln
Octocat-spinner-32 loggly.nuspec
Octocat-spinner-32 package.cmd
Octocat-spinner-32 readme.md
readme.md

Loggly .NET Driver

This is a .NET driver for loggly.com.

Logging Events

Please note that as of the 2.0 release, async logging is the default. To log synchronously, use the corresponding Sync methods (Log vs LogSync)

Create a new Logger with your input key:

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

For JSON logging you can use LogInfo, LogVerbose, LogWarning, LogError methods that will create json objects with properties like category, message, exception (if applicable), extra data that you provide.

Use either a synchronous or asynchronous Log method.

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.

For JSON search you can use SearchJson 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

Integration Tests

To run the integration tests, you'll need to place a config.user file in the test's debug folder (assuming you are running tests in debug). The file should look something like:

<appSettings>
    <add key="IntegrationKey" value="YOUR KEY"></add>
    <add key="IntegrationUser" value="YOUR USERNAME"></add>
    <add key="IntegrationPassword" value="YOUR PASSWORD"></add>
</appSettings>
Something went wrong with that request. Please try again.