Last updated at Tue, 31 Oct 2017 18:36:44 GMT

One of our most popular libraries at Logentries is our .NET integration. We offer support for both Nlog and Log4net. We want to continue to expand Logentries support for .NET environments, and we are pleased to announce our new integration for Windows Phone. With the Windows Phone logging module you can now easily centralize, search and analyze important log events that occur in your app.

Setting up the Log Appender in your code is easy. Simply inject this initialization method when your app launches. Making sure to add in your Log Token.

// Code to execute when the application is launching (e.g., from Start)
// This code will not execute when the application is reactivated

private void Application_Launching(object sender, LaunchingEventArgs e)
{
       Logentries.LogentriesService.Initialize(this, "LOG_TOKEN");
}

Then, activate the Logentries service like so:

// Code to execute when the application is activated (brought to foreground)
// This code will not execute when the application is first launched

private void Application_Activated(object sender, ActivatedEventArgs e)
{
    Logentries.LogentriesService.Activate(this);
}

Now that we have our Log Appender setup we can log from within our application. The LogentriesAppender comes with a number of severity levels which lets you sum up the situation in hand. For example, if you a condition in your code what you want to be alerted on, you can use the Alert Severity. Once logged it will come out in the following format.

Thu 29 May 11:24:55 +0100 2014, severity=Alert, My Log Message!

You can see some of the sample logs that are produced when I log into my Account.

Windows Phone logging severity alertsIn my sample application, I set up a simple UI to test the functionality of these severity levels. Each time a button is pressed the corresponding log method is invoked from the Event handler.

Sample logging events for Windows Phone Integration
These logging methods can be seen below.

LogentriesService.Log(“My log message.”)

LogentriesService.Debug(“My log message.”)

LogentriesService.Info(“My log message.”)

LogentriesService.Notice(“My log message.”)

LogentriesService.Error(“My log message.”)

LogentriesService.Warning(“My log message.”)

LogentriesService.Critical(“My log message.”)

LogentriesService.Alert(“My log message.”)

LogentriesService.Emergency(“My log message.”)

LogentriesService.Crash(“My log message.”)

With the Windows Phone Logentries Log Appender we are able to unlock another point in your stack to extract valuable insights into what is happening in your application. If you’re interested in getting your hands on the beta copy, let us know and we’ll get you signed up: beta@logentries.com