Skip to content

Instantly share code, notes, and snippets.

@pwelter34
Created May 3, 2013 20:59
Show Gist options
  • Save pwelter34/5514092 to your computer and use it in GitHub Desktop.
Save pwelter34/5514092 to your computer and use it in GitHub Desktop.
NLog.Mongo custom format
{
"_id" : ObjectId("5184219b545eb455aca34391"),
"Date" : "2013-05-03 15:44:11.7942",
"Level" : "Error",
"Message" : "Error reading file 'blah.txt'.",
"Logger" : "NLog.Mongo.ConsoleTest.Program",
"Exception" : "System.IO.FileNotFoundException: Could not find file 'C:\\Projects\\github\\NLog.Mongo\\Source\\NLog.Mongo.ConsoleTest\\bin\\Debug\\blah.txt'.\r\nFile name: 'C:\\Projects\\github\\NLog.Mongo\\Source\\NLog.Mongo.ConsoleTest\\bin\\Debug\\blah.txt'\r\n at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)\r\n at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)\r\n at System.IO.File.ReadAllText(String path)\r\n at NLog.Mongo.ConsoleTest.Program.Main(String[] args) in c:\\Projects\\github\\NLog.Mongo\\Source\\NLog.Mongo.ConsoleTest\\Program.cs:line 35",
"ThreadID" : "10",
"ProcessID" : "21932",
"ProcessName" : "C:\\Projects\\github\\NLog.Mongo\\Source\\NLog.Mongo.ConsoleTest\\bin\\Debug\\NLog.Mongo.ConsoleTest.vshost.exe",
"UserName" : "GLOBAL\\paul.welter"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment