A lightweight logging system designed specifically for Windows Store and Windows Phone 8 apps.
C# JavaScript CSS HTML ASP
Latest commit 73ed550 Apr 18, 2016 @onovotny Merge pull request #81 from lprichar/dev
Fixed issue with JsonPostTarget not allowing custom auth headers
Permalink
Failed to load latest commit information.
MetroLog.Android Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
MetroLog.NetCore Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
MetroLog.NetFx Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
MetroLog.Shared.WinRT Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
MetroLog.Shared Fixed issue with JsonPostTarget not passing its HttpClient to the OnB… Apr 14, 2016
MetroLog.Targets.SQLite Update SQLite files Jan 8, 2016
MetroLog.Tests Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
MetroLog.WP8.Tests rename win81 projects Jan 8, 2016
MetroLog.WP8 Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
MetroLog.Win81.Tests Ensure that log messages are formatted on the calling thread to keep … Feb 3, 2016
MetroLog.Win81 Add dotnet/.NET Core Jan 8, 2016
MetroLog.WinRT rename win81 projects Jan 8, 2016
MetroLog.Wpa81 Convert into "bait and switch" PCL Jan 7, 2016
MetroLog.iOS-Unified Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
MetroLog.iOS Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
MetroLog Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
Samples/ConsoleSample Code style cleanup Jan 8, 2016
WebTargetSample update to xunit 2.1 Oct 18, 2015
Win8Sample fix sqlite share sample Jan 8, 2016
WinJSSample update dev keys Oct 17, 2015
iOSClassicSample Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
iOSUnifiedSample Restore missing SnapshotFileTarget and add way to close stream after … Jan 14, 2016
packages Update xunit Feb 10, 2015
typescript Update TS Mar 17, 2014
.gitattributes change order Oct 31, 2012
.gitignore Update .gitignore Jan 7, 2016
GitVersionConfig.yaml update ver Jan 8, 2016
LICENSE.txt Added text of MIT license as it was missing Sep 7, 2012
MetroLog ReadMe.txt Fix issue where readme was considered a content resource by the winmd… Nov 1, 2012
MetroLog.nuspec Rework file streaming targets to keep stream open for duration of app… Jan 8, 2016
MetroLog.sln Add dotnet/.NET Core Jan 8, 2016
MetroLog.sln.DotSettings Code style cleanup Jan 8, 2016
MetroLog.snk Initial split into portable core Sep 6, 2012
README.mdown Readme Sep 17, 2012
appveyor.yml push nupgks to CI feed Jan 8, 2016
nuget.config rename win81 projects Jan 8, 2016

README.mdown

Overview

MetroLog is a lightweight logging framework designed for Windows Store and Windows Phone 8 apps. Although the API is based on NLog and log4net, the intention is that it's a very basic logging system.

The need for it to be basic comes from the fact that the Windows Store apps API surface area intentionally limited for very specific applications. This project came out of the fact that porting NLog to Windows Store apps is difficult because of it's incredibly rich feature set, most of which is not workable in Windows Store apps.

Out-of-the-box, logging operations are intended to send all log levels to Debug.WriteLine and EventTracingForWindows (ETW). and ERROR and FATAL levels to a file in the app's LocalState folder using FileSnapshotTarget.

Caution on using Debug.WriteLine with NuGet. The NuGet packages are compiled as RELEASE mode and Debug.WriteLine calls are #ifdef'd out. Use the ETW mode, or FileStreamingTarget to see levels TRACE through WARN.

For Windows Store apps we recommend that you configure the SQLiteTarget. For support purposes, you can load entries back out of the SQLite database and package them for email over the Share charm.

You can use JsonPostTarget to stream log messages back to an HTTP/HTTPS end-point of your own design. (Although we provide a sample app.)

We ensure that MetroLog is compataible with WACK requirements.

Documentation

The intention is that MetroLog is mostly compatible with NLog. Both the surface area and internal construction should just about match.

To get started, read the Configuration entry in the wiki.

Unit testing

This project uses xUnit.NET, rather than the built-in MSTest. Use the xUnit.NET Test Runner for Visual Studio 2012 to enable VS 2012 to discover and run the unit tests.

Meta

This is an open source project that welcomes contributions/suggestions/bug reports from those who use it. If you have any ideas on how to improve the library, please contact @mbrit or @onovotny.

MetroLog is distributed under the MIT license.