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.

1 2 3 4 5 6 7 // 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:

1 2 3 4 5 6 7 // 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 Logentries Appender comes with a number of severity levels which lets you sum up the situation in hand: For example, if you have 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.

In 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.

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 at logentries dot com