Last active
April 7, 2017 18:57
-
-
Save dimitrispaxinos/f466855297c2372d0400 to your computer and use it in GitHub Desktop.
Serilog: Log with dynamic Object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var dynamicObject = new | |
| { | |
| OperatingSystem = "Windows", | |
| Username = "TestUser", | |
| OneMoreRandomProperty = "Random Property Value " | |
| }; | |
| using (LogContext.PushProperty("DynamicObject", dynamicObject, destructureObjects: true)) | |
| { | |
| Log.Logger.Information("This log entry includes a dynamic object"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment