[{"data":1,"prerenderedAt":354},["ShallowReactive",2],{"post-\u002Flogging-with-serilog-exceptions\u002F":3},{"id":4,"title":5,"author":6,"body":7,"comments":248,"date":330,"dateModified":331,"description":332,"extension":333,"headings":334,"heroImage":341,"meta":342,"path":343,"permalink":343,"published":344,"stem":345,"tags":346,"timeToRead":353},"posts\u002Fposts\u002F2016\u002Flogging-with-serilog-exceptions\u002Findex.md","Logging with Serilog.Exceptions","Muhammad Rehan Saeed",{"type":8,"value":9,"toc":245},"minimark",[10,43,66,69,76,79,84,95,104,113,123,134,150,165,178,189,200,203,206,209,220,223,228,235,238,241],[11,12,13,14,24,25,30,31,36,37,42],"p",{},"Picking a logging framework for your new .NET project? I've tried all the best known ones, including ",[15,16,23],"a",{"href":17,"rel":18,"target":22},"https:\u002F\u002Flogging.apache.org\u002Flog4net\u002F",[19,20,21],"nofollow","noopener","noreferrer","_blank","log4net",", ",[15,26,29],{"href":27,"rel":28,"target":22},"http:\u002F\u002Fnlog-project.org\u002F",[19,20,21],"NLog"," and Microsoft's ",[15,32,35],{"href":33,"rel":34,"target":22},"https:\u002F\u002Fmsdn.microsoft.com\u002Fen-us\u002Flibrary\u002Fff647183.aspx",[19,20,21],"Logging Application Block",". All of these logging frameworks basically output plain text but recently I tried ",[15,38,41],{"href":39,"rel":40,"target":22},"http:\u002F\u002Fserilog.net\u002F",[19,20,21],"Serilog"," and was literally blown away by what you could do with it.",[44,45,47,65],"h1",{"id":46},"logging-in-json-format",[15,48,51],{"href":49,"aria-hidden":50},"#logging-in-json-format","true",[52,53,59],"svg",{"xmlns":54,"xmlns:xlink":55,"viewBox":56,"version":57,"width":58,"height":58,"aria-hidden":50},"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxlink","0 0 16 16","1.1",22,[60,61],"path",{"fill":62,"fill-rule":63,"d":64},"currentColor","evenodd","M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z","Logging in JSON Format",[11,67,68],{},"Take a look at the code below which makes use of the Serilog logger to log a geo-coordinate and an integer:",[70,71],"pre",{"className":72,"language":73,"meta":74,"style":74,"html":75},"language-cs shiki shiki-themes light-plus monokai","cs","","\u003Cspan class=\"line\">\u003Cspan class=\"s4J9F\">var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> position\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> new\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> { \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Latitude\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"s0PsH\"> 25\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Longitude\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"s0PsH\"> 134\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> };\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s4J9F\">var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> elapsedMs\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"s0PsH\"> 34\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">log\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Information\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"Processed {@Position} in {Elapsed:000} ms.\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">position\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">elapsedMs\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>",[11,77,78],{},"If you configure Serilog correctly, you can get it to output it's logs to JSON format, so the above line would log the following:",[70,80],{"className":81,"language":82,"meta":74,"style":74,"html":83},"language-json shiki shiki-themes light-plus monokai","json","\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"Timestamp\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"2015-12-07T12:26:24.0557671+00:00\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"Level\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Information\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"MessageTemplate\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Processed {@Position} in {Elapsed:000} ms.\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"RenderedMessage\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Processed { Latitude: 25, Longitude: 134 } in 034 ms.\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"Properties\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"Position\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    { \n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">        \"Latitude\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">25\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">        \"Longitude\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">134\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }, \n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"Elapsed\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">34\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"ProcessId\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">123\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"ThreadId\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">123\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"User\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Domain\u003C\u002Fspan>\u003Cspan class=\"shFVe\">\\\\\u003C\u002Fspan>\u003Cspan class=\"syaXe\">Username\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"Machine\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Machine-Name\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"Source\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"My Application Name\"\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">  }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[44,85,87,94],{"id":86},"why-json",[15,88,90],{"href":89,"aria-hidden":50},"#why-json",[52,91,92],{"xmlns":54,"xmlns:xlink":55,"viewBox":56,"version":57,"width":58,"height":58,"aria-hidden":50},[60,93],{"fill":62,"fill-rule":63,"d":64},"Why JSON?",[11,96,97,98,103],{},"What can you do with JSON formatted logs that you can't do with plain text? Well, if you store all your logs in something like ",[15,99,102],{"href":100,"rel":101,"target":22},"https:\u002F\u002Fwww.elastic.co\u002Fwebinars\u002Fget-started-with-elasticsearch?elektra=home&storm=banner",[19,20,21],"Elastic Search",", you can query your logs and ask it questions. So if we take the above example further we could find all log messages from a particular machine or user with an elapsed time of more than 10 milliseconds and a distance of 10 Km away from the specific location.",[11,105,106,107,112],{},"Not only that but if you set up something like ",[15,108,111],{"href":109,"rel":110,"target":22},"https:\u002F\u002Fwww.elastic.co\u002Fproducts\u002Fkibana",[19,20,21],"Kibana",", then you can create visualisations for your logs which could grow to be gigabytes in size over time. You can create dashboards with cool charts and maps that look something like this:",[11,114,115],{},[116,117],"img",{"alt":118,"src":119,"width":120,"height":121,"loading":122},"Kibana Dashboard Screenshot","\u002Fcontent-images\u002Fposts\u002F2016\u002Flogging-with-serilog-exceptions\u002Fimages\u002FKibana-Screenshot.png",1337,753,"lazy",[44,124,126,133],{"id":125},"logging-exceptions",[15,127,129],{"href":128,"aria-hidden":50},"#logging-exceptions",[52,130,131],{"xmlns":54,"xmlns:xlink":55,"viewBox":56,"version":57,"width":58,"height":58,"aria-hidden":50},[60,132],{"fill":62,"fill-rule":63,"d":64},"Logging Exceptions",[11,135,136,137,141,142,145,146,149],{},"One major problem with all exceptions is that they do not log all the properties of an exception and throw away vital information. Take the ",[138,139,140],"code",{},"DbEntityValidationException"," from EntityFramework as an example. This exception contains vital information buried not in the message but in a custom property called ",[138,143,144],{},"EntityValidationErrors",". The problem is that when you do an ",[138,147,148],{},"exception.ToString()"," call, this vital information is not included in the resulting string. Even worse, it's not included in the debugger either. This is a pretty major failing in the .NET framework but alas we have to work around it.",[11,151,152,153,158,159,161,162,164],{},"There are literally dozens of questions on ",[15,154,157],{"href":155,"rel":156,"target":22},"https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002F15820505\u002Fdbentityvalidationexception-how-can-i-easily-tell-what-caused-the-error",[19,20,21],"Stack Overflow"," asking how to deal with this problem and all the major logging frameworks fail in this regard. All of them call ",[138,160,148],{}," and fail to log the ",[138,163,144],{}," collection.",[11,166,167,169,170,173,174,177],{},[138,168,140],{}," is not the only culprit, half the exceptions in the .NET framework contain custom properties that are not logged. The ",[138,171,172],{},"Exception"," base class itself has a ",[138,175,176],{},"Data"," dictionary collection which is never logged either.",[44,179,181,188],{"id":180},"serilogexceptions",[15,182,184],{"href":183,"aria-hidden":50},"#serilogexceptions",[52,185,186],{"xmlns":54,"xmlns:xlink":55,"viewBox":56,"version":57,"width":58,"height":58,"aria-hidden":50},[60,187],{"fill":62,"fill-rule":63,"d":64},"Serilog.Exceptions",[11,190,191,192,196,197,199],{},"I wrote ",[15,193,188],{"href":194,"rel":195,"target":22},"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002FSerilog.Exceptions",[19,20,21]," to solve this problem. So what happens when you log a ",[138,198,140],{}," using this NuGet package added to Serilog itself? Well take a look yourself:",[70,201],{"className":81,"language":82,"meta":74,"style":74,"html":202},"\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"Timestamp\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"2015-12-07T12:26:24.0557671+00:00\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"Level\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Error\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"MessageTemplate\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Hello World\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"RenderedMessage\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Hello World\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"Exception\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"System.Data.Entity.Validation.DbEntityValidationException: Message\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">  \"Properties\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"ExceptionDetail\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">      \"EntityValidationErrors\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: [\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">          \"Entry\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"sMc8R\">null\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">          \"ValidationErrors\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: [\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">              \"PropertyName\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"PropertyName\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">              \"ErrorMessage\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"PropertyName is Required.\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">              \"Type\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"System.Data.Entity.Validation.DbValidationError\"\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">          ],\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">          \"IsValid\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"sMc8R\">false\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">          \"Type\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"System.Data.Entity.Validation.DbEntityValidationResult\"\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">      ],\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">      \"Message\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">      \"Data\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: {},\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">      \"InnerException\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"sMc8R\">null\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">      \"TargetSite\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"sMc8R\">null\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">      \"StackTrace\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"sMc8R\">null\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">      \"HelpLink\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"sMc8R\">null\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">      \"Source\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"sMc8R\">null\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">      \"HResult\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">-2146232032\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">      \"Type\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"System.Data.Entity.Validation.DbEntityValidationException\"\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    },\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"ProcessId\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">123\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"ThreadId\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">123\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"User\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Domain\u003C\u002Fspan>\u003Cspan class=\"shFVe\">\\\\\u003C\u002Fspan>\u003Cspan class=\"syaXe\">Username\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"Machine\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"Machine-Name\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"Source\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"My Application Name\"\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">  }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[11,204,205],{},"It logs every single property of the exception and not only that but it drills down even further into the object hierarchy and logs that information too.",[11,207,208],{},"You're probably thinking it uses reflection right? Well...sometimes. This library has custom code to deal with extra properties on most common exception types and only falls back to using reflection to get the extra information if the exception is not supported by Serilog.Exceptions internally.",[44,210,212,219],{"id":211},"getting-started-with-serilogexceptions",[15,213,215],{"href":214,"aria-hidden":50},"#getting-started-with-serilogexceptions",[52,216,217],{"xmlns":54,"xmlns:xlink":55,"viewBox":56,"version":57,"width":58,"height":58,"aria-hidden":50},[60,218],{"fill":62,"fill-rule":63,"d":64},"Getting Started with Serilog.Exceptions",[11,221,222],{},"Add the Serilog.Exceptions NuGet package to your project using the NuGet Package Manager or run the following command in the Package Console Window:",[70,224],{"className":225,"language":226,"meta":74,"style":74,"html":227},"language-powershell shiki shiki-themes light-plus monokai","powershell","\u003Cspan class=\"line\">\u003Cspan class=\"sWhak\">Install-Package\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> Serilog.Exceptions\n\u003C\u002Fspan>\u003C\u002Fspan>",[11,229,230,231,234],{},"When setting up your logger, add the ",[138,232,233],{},"WithExceptionDetails"," line like so:",[70,236],{"className":72,"language":73,"meta":74,"style":74,"html":237},"\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">using\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> Serilog\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">using\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> Serilog\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sw29p\">Exceptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sw29p\">ILogger\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> logger\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> LoggerConfiguration\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    .\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Enrich\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">WithExceptionDetails\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    .\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">WriteTo\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Sink\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> RollingFileSink\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"swiDo\">        @\"C:\\logs\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">        new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> JsonFormatter\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">renderMessage\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"sMc8R\">true\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">))\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">CreateLogger\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">();\n\u003C\u002Fspan>\u003C\u002Fspan>",[11,239,240],{},"That's it, it's one line of code!",[242,243,244],"style",{},"html pre.shiki code .s4J9F, html code.shiki .s4J9F{--shiki-default:#0000FF;--shiki-default-font-style:inherit;--shiki-dark:#66D9EF;--shiki-dark-font-style:italic}html pre.shiki code .sFrd5, html code.shiki .sFrd5{--shiki-default:#001080;--shiki-dark:#F8F8F2}html pre.shiki code .snCLD, html code.shiki .snCLD{--shiki-default:#000000;--shiki-dark:#F92672}html pre.shiki code .sJvqV, html code.shiki .sJvqV{--shiki-default:#0000FF;--shiki-dark:#F92672}html pre.shiki code .sjLUg, html code.shiki .sjLUg{--shiki-default:#000000;--shiki-dark:#F8F8F2}html pre.shiki code .s0PsH, html code.shiki .s0PsH{--shiki-default:#098658;--shiki-dark:#AE81FF}html pre.shiki code .sWm5y, html code.shiki .sWm5y{--shiki-default:#795E26;--shiki-dark:#A6E22E}html pre.shiki code .swiDo, html code.shiki .swiDo{--shiki-default:#A31515;--shiki-dark:#E6DB74}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .svrZB, html code.shiki .svrZB{--shiki-default:#0451A5;--shiki-default-font-style:inherit;--shiki-dark:#66D9EF;--shiki-dark-font-style:italic}html pre.shiki code .syaXe, html code.shiki .syaXe{--shiki-default:#A31515;--shiki-dark:#CFCFC2}html pre.shiki code .shFVe, html code.shiki .shFVe{--shiki-default:#EE0000;--shiki-dark:#AE81FF}html pre.shiki code .sMc8R, html code.shiki .sMc8R{--shiki-default:#0000FF;--shiki-dark:#AE81FF}html pre.shiki code .sWhak, html code.shiki .sWhak{--shiki-default:#795E26;--shiki-dark:#66D9EF}html pre.shiki code .smL5M, html code.shiki .smL5M{--shiki-default:#AF00DB;--shiki-dark:#F92672}html pre.shiki code .sw29p, html code.shiki .sw29p{--shiki-default:#267F99;--shiki-default-text-decoration:inherit;--shiki-dark:#A6E22E;--shiki-dark-text-decoration:underline}",{"title":74,"searchDepth":246,"depth":246,"links":247},2,[],{"issue":249,"comments":253},{"number":250,"title":251,"html_url":252},85,"[Comment] Logging with Serilog.Exceptions","https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F85",[254,266,274,282,290,298,306,314,322],{"id":255,"html_url":256,"body_html":257,"created_at":258,"user":259,"reactions":263},627262412,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F85#issuecomment-627262412","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F2298cc7144f51f3de3422c3a5cadd647425d8f2f290fb74ed9e5a2bc09839a85\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f39366133653162636231343664313931666436653732326336356331623865643f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Manav Ghosh\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F2298cc7144f51f3de3422c3a5cadd647425d8f2f290fb74ed9e5a2bc09839a85\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f39366133653162636231343664313931666436653732326336356331623865643f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>Manav Ghosh\u003C\u002Fstrong> commented on \u003Cstrong>2016-04-01 09:51:48\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Hi,\u003Cbr \u002F>\nIs there a way I can configure Serilog.Exceptions settings in a \u003Ccode>web.config\u003C\u002Fcode> or \u003Ccode>app.config\u003C\u002Fcode> file. Kindly help me with some sample settings.\u003C\u002Fp>","2020-05-12T10:41:56Z",{"login":260,"avatar_url":261,"html_url":262},"RehanSaeed","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2270364?v=4","https:\u002F\u002Fgithub.com\u002FRehanSaeed",{"url":264,"total_count":265,"+1":265,"-1":265,"laugh":265,"hooray":265,"confused":265,"heart":265,"rocket":265,"eyes":265},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627262412\u002Freactions",0,{"id":267,"html_url":268,"body_html":269,"created_at":270,"user":271,"reactions":272},627262461,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F85#issuecomment-627262461","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Muhammad Rehan Saeed\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\u002F\u002Frehansaeed.com\u002F\">Muhammad Rehan Saeed\u003C\u002Fa>\u003C\u002Fstrong> commented on \u003Cstrong>2016-04-01 10:23:25\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>Hi,\u003Cbr \u002F>\nIs there a way I can configure Serilog.Exceptions settings in a \u003Ccode>web.config\u003C\u002Fcode> or \u003Ccode>app.config\u003C\u002Fcode> file. Kindly help me with some sample settings.\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>The only thing you can configure in Serilog.Exceptions is to add other custom exceptions, so that they are serialized faster and this needs to be done in code.\u003C\u002Fp>\n\u003Cp>Serilog itself, which is a separate project has a method of using config.\u003C\u002Fp>","2020-05-12T10:42:03Z",{"login":260,"avatar_url":261,"html_url":262},{"url":273,"total_count":265,"+1":265,"-1":265,"laugh":265,"hooray":265,"confused":265,"heart":265,"rocket":265,"eyes":265},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627262461\u002Freactions",{"id":275,"html_url":276,"body_html":277,"created_at":278,"user":279,"reactions":280},627262514,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F85#issuecomment-627262514","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002Ff2d1633dbd030139099514762eb4ae2052ee9302f323f9048b6494ac59f7683c\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f65636361376439333961356136303935313230306539656231643965396231393f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Mike Breytenbach\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002Ff2d1633dbd030139099514762eb4ae2052ee9302f323f9048b6494ac59f7683c\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f65636361376439333961356136303935313230306539656231643965396231393f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"http:\u002F\u002Fwww.beyonddata.co.za\u002F\">Mike Breytenbach\u003C\u002Fa>\u003C\u002Fstrong> commented on \u003Cstrong>2016-10-16 20:26:05\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Amazing post! Thanks so much.\u003C\u002Fp>","2020-05-12T10:42:10Z",{"login":260,"avatar_url":261,"html_url":262},{"url":281,"total_count":265,"+1":265,"-1":265,"laugh":265,"hooray":265,"confused":265,"heart":265,"rocket":265,"eyes":265},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627262514\u002Freactions",{"id":283,"html_url":284,"body_html":285,"created_at":286,"user":287,"reactions":288},627262551,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F85#issuecomment-627262551","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8da15260064b2d00f7d62453f2625a574f64a96c1238a729b56bd28e678605c1\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f64626462653834663437313136663861343866643565376235356535303234333f733d393626643d6d6d26723d67\">\u003Cimg alt=\"preguntoncojonero\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8da15260064b2d00f7d62453f2625a574f64a96c1238a729b56bd28e678605c1\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f64626462653834663437313136663861343866643565376235356535303234333f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>preguntoncojonero\u003C\u002Fstrong> commented on \u003Cstrong>2016-11-03 21:27:03\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Full source code c# app using Serilog in GitHub? real world\u003C\u002Fp>\n\u003Cp>And Serilog + ELK (kibana) ?\u003C\u002Fp>","2020-05-12T10:42:17Z",{"login":260,"avatar_url":261,"html_url":262},{"url":289,"total_count":265,"+1":265,"-1":265,"laugh":265,"hooray":265,"confused":265,"heart":265,"rocket":265,"eyes":265},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627262551\u002Freactions",{"id":291,"html_url":292,"body_html":293,"created_at":294,"user":295,"reactions":296},627262609,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F85#issuecomment-627262609","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Muhammad Rehan Saeed\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\u002F\u002Frehansaeed.com\u002F\">Muhammad Rehan Saeed\u003C\u002Fa>\u003C\u002Fstrong> commented on \u003Cstrong>2016-11-04 09:36:36\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>Full source code c# app using Serilog in GitHub? real world\u003C\u002Fp>\n\u003Cp>And Serilog + ELK (kibana) ?\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>I use Serilog + ELK in my company but obviously can't show you that. If you want blog posts, Google it, I've seen blog posts about people using Serilog and Seq and many blog posts out there about people using ELK and Serilog separately. If you want GitHub examples, you can do an advanced search for Serilog across all repositories.\u003C\u002Fp>","2020-05-12T10:42:23Z",{"login":260,"avatar_url":261,"html_url":262},{"url":297,"total_count":265,"+1":265,"-1":265,"laugh":265,"hooray":265,"confused":265,"heart":265,"rocket":265,"eyes":265},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627262609\u002Freactions",{"id":299,"html_url":300,"body_html":301,"created_at":302,"user":303,"reactions":304},627262655,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F85#issuecomment-627262655","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8da15260064b2d00f7d62453f2625a574f64a96c1238a729b56bd28e678605c1\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f64626462653834663437313136663861343866643565376235356535303234333f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Preguntoncojonero\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8da15260064b2d00f7d62453f2625a574f64a96c1238a729b56bd28e678605c1\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f64626462653834663437313136663861343866643565376235356535303234333f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>Preguntoncojonero\u003C\u002Fstrong> commented on \u003Cstrong>2017-03-29 12:36:31\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Thanks a lot for your big efforts. You're right.\u003C\u002Fp>\n\u003Cp>In your real projects, NOT USE log4net, NLog and Microsoft's Logging Application Block. ONLY USE Serilog (and Serilog.Exceptions) to generate structured data file. Optionally, you can store all your logs in ELK stack, isn't?\u003C\u002Fp>\n\u003Cp>IMHO, better samples for minimize learning curve are real applications with full source code and good patterns and practices. Full source code sample REAL application? not Demo, only real applications?\u003Cbr \u002F>\nI think, the better, full real samples in github+codeplex+codeproject with full source code and using good patterns and practices: \"advanced search across all repositories\", better if anyone knows a good project with patterns.\u003C\u002Fp>\n\u003Cp>Googling I have a BIG BANG FAT repository of links and infinitum code. Really.\u003C\u002Fp>\n\u003Cp>Mindly notes:\u003C\u002Fp>\n\u003Cp>main influences, are full of innovative ideas that can free our minds to explore new techniques, patterns and paradigms.\u003C\u002Fp>\n\u003Cp>You want to use technologies that allow for rapid development, constant iteration, maximal efficiency, speed, robustness and more. You want to be lean and you want to be agile. You want to use technologies that will help you succeed in the short and long term. And those technologies are not always easy to pick out.\u003C\u002Fp>\n\u003Cp>Mindly notes 2:\u003Cbr \u002F>\nYou have REAL experienced.\u003C\u002Fp>\n\u003Cp>About it Serilog + NET Apps (optional EL-Kibana), any step-by-step guide, or Getting Started - Quick Start that can be completed in 15-20 minutes?\u003C\u002Fp>\n\u003Cp>I get you a good step-by-step guide sample like \u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\u002F\u002Fberniecook.wordpress.com\u002F2013\u002F01\u002F13\u002Fgetting-started-with-git-and-visual-studio-step-by-step-guide\u002F\">https:\u002F\u002Fberniecook.wordpress.com\u002F2013\u002F01\u002F13\u002Fgetting-started-with-git-and-visual-studio-step-by-step-guide\u002F\u003C\u002Fa>\u003C\u002Fp>\n\u003Cp>I wanted to quickly cover off several assumptions before we get started: install (requisites, tools required), configure, and running quickly. Target will be an \"go and ready\" sample.\u003C\u002Fp>","2020-05-12T10:42:30Z",{"login":260,"avatar_url":261,"html_url":262},{"url":305,"total_count":265,"+1":265,"-1":265,"laugh":265,"hooray":265,"confused":265,"heart":265,"rocket":265,"eyes":265},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627262655\u002Freactions",{"id":307,"html_url":308,"body_html":309,"created_at":310,"user":311,"reactions":312},627262702,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F85#issuecomment-627262702","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F781e57be88779f7b7f83dadb46c7fb108c9fc8136ac85a249021d83a79814f76\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f33333062333265633532333131653538323962333166643263623534306366373f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Steve Graddy\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F781e57be88779f7b7f83dadb46c7fb108c9fc8136ac85a249021d83a79814f76\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f33333062333265633532333131653538323962333166643263623534306366373f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>Steve Graddy\u003C\u002Fstrong> commented on \u003Cstrong>2017-05-15 17:15:45\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Was having issue with Serilog.Extensions.Logging and Serilog.Sinks.MSSqlServerCore in ASP.NET Core 1.1 writing to database, it created logs table with no issue but would not write data. Finally got SerilogSelfLog working and was able to determine that the issue was the exception value was always null even though I know I am passing an exception object in the logger.LogError(\"my error\", ex). Fixed the database column by allowing nulls and not I get data in table but the Exception column never gets any values. Looks like same issue within the rollingFile output (EX: 2017-05-15 08:06:52.471 -05:00 [Error] my error ). All the logging seems to be working now except I have no exception or exception details logged anywhere although the Error line or row in database is written. So I added your Serilog.Exceptions to my ASP.NET Core 1.1 Serilog setup as you describe above and I am still not seeing any exception or exception details logged in either the RollingFile or the MSSQL Server database. Have you any idea as to what might be happening.\u003C\u002Fp>","2020-05-12T10:42:37Z",{"login":260,"avatar_url":261,"html_url":262},{"url":313,"total_count":265,"+1":265,"-1":265,"laugh":265,"hooray":265,"confused":265,"heart":265,"rocket":265,"eyes":265},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627262702\u002Freactions",{"id":315,"html_url":316,"body_html":317,"created_at":318,"user":319,"reactions":320},627262755,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F85#issuecomment-627262755","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Muhammad Rehan Saeed\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\u002F\u002Frehansaeed.com\u002F\">Muhammad Rehan Saeed\u003C\u002Fa>\u003C\u002Fstrong> commented on \u003Cstrong>2017-05-18 15:22:25\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>Was having issue with Serilog.Extensions.Logging and Serilog.Sinks.MSSqlServerCore in ASP.NET Core 1.1 writing to database, it created logs table with no issue but would not write data. Finally got SerilogSelfLog working and was able to determine that the issue was the exception value was always null even though I know I am passing an exception object in the logger.LogError(\"my error\", ex). Fixed the database column by allowing nulls and not I get data in table but the Exception column never gets any values. Looks like same issue within the rollingFile output (EX: 2017-05-15 08:06:52.471 -05:00 [Error] my error ). All the logging seems to be working now except I have no exception or exception details logged anywhere although the Error line or row in database is written. So I added your Serilog.Exceptions to my ASP.NET Core 1.1 Serilog setup as you describe above and I am still not seeing any exception or exception details logged in either the RollingFile or the MSSQL Server database. Have you any idea as to what might be happening.\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002FSerilog.Exceptions\u002Fissues\u002F21\">https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002FSerilog.Exceptions\u002Fissues\u002F21\u003C\u002Fa>\u003C\u002Fp>","2020-05-12T10:42:44Z",{"login":260,"avatar_url":261,"html_url":262},{"url":321,"total_count":265,"+1":265,"-1":265,"laugh":265,"hooray":265,"confused":265,"heart":265,"rocket":265,"eyes":265},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627262755\u002Freactions",{"id":323,"html_url":324,"body_html":325,"created_at":326,"user":327,"reactions":328},627262804,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F85#issuecomment-627262804","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002Fc357df6f3b2cdefef4fa3074bd0c18f9ea97744d43a3f97b69f3edd8f49cab12\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f34346364626334363463376137643765373061633563623537323830346265333f733d393626643d6d6d26723d67\">\u003Cimg alt=\"mohammad\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002Fc357df6f3b2cdefef4fa3074bd0c18f9ea97744d43a3f97b69f3edd8f49cab12\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f34346364626334363463376137643765373061633563623537323830346265333f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"http:\u002F\u002Flotfibit.ir\u002F\">mohammad\u003C\u002Fa>\u003C\u002Fstrong> commented on \u003Cstrong>2019-05-27 19:27:59\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>That's cool\u003C\u002Fp>","2020-05-12T10:42:51Z",{"login":260,"avatar_url":261,"html_url":262},{"url":329,"total_count":265,"+1":265,"-1":265,"laugh":265,"hooray":265,"confused":265,"heart":265,"rocket":265,"eyes":265},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627262804\u002Freactions","2016-01-31T00:00:00+00:00",null,"Log exception details and custom properties that are not output in Exception.ToString() using Serilog.Exceptions for .NET.","md",[335,337,338,339,340],{"depth":336,"value":65},1,{"depth":336,"value":94},{"depth":336,"value":133},{"depth":336,"value":188},{"depth":336,"value":219},"\u002Fimages\u002Fhero\u002FSerilog.Exceptions-1366x768.png",{},"\u002Flogging-with-serilog-exceptions\u002F",true,"posts\u002F2016\u002Flogging-with-serilog-exceptions\u002Findex",[347,348,349,350,351,352,41,188],".NET","Base Class Library","BCL","C#","GitHub","NuGet",3,1792876122012]