Created
November 3, 2015 18:37
-
-
Save dimitrispaxinos/3f8b01cc087eae37063f to your computer and use it in GitHub Desktop.
Serilog: Include class name in the context
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
| // Explicitly including the class | |
| Log.Logger.ForContext<MainWindow>().Information("This log entry includes the class name as context"); | |
| // More generic getting the type of the class we are in | |
| Log.Logger.ForContext(this.GetType()).Information("This log entry includes the class name as context"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment