Last active
July 12, 2018 14:36
-
-
Save vector623/916011088f619e41c8461e8436113561 to your computer and use it in GitHub Desktop.
format dynamic expando objects with Serilog
This file contains 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
Log.Logger = new LoggerConfiguration() | |
.MinimumLevel.Debug() | |
.Destructure.ByTransforming<ExpandoObject>(JsonConvert.SerializeObject) | |
.WriteTo.AzureAnalytics( | |
workspaceId: Configuration["AZUREANALYTICS_WORKSPACEID"], | |
authenticationId: Configuration["AZUREANALYTICS_AUTHENTICATIONID"], | |
logName: "logTableName", | |
restrictedToMinimumLevel: LogEventLevel.Debug, | |
batchSize: 10) | |
.CreateLogger(); | |
var loggerFactory = new LoggerFactory() | |
.AddSerilog(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment