Reputation: 63
I have an ASP.Net Core 2.1 API running in a Azure AppService, the Azure Diagnostics Log "Application Logging (Blob)" is turned on.
The problem is that it's just logging with the default format "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}".
I would like to store the logs in exact same format as ASP.NET Framework 4.7, in .CSV and with information like date/level in different columns.
If it's not possible, I would like at least store just the {Message} and not the whole timestamp.
Example of ASP.NET Framework 4.7 logs in Blob Storage: ASP.Net Framework Log File
Example of ASP.NET Core 2.1 logs in Blob Storage: ASP.Net Core 2.1 Log File
My log configuration: ILoggerFactory configuration
Upvotes: 0
Views: 156
Reputation: 2654
I'm afraid you'll need a custom logger to achieve what you want.
Take a look at Customizing ASP.NET Core Part 01: Logging and How to add custom logging in ASP.NET Core to see how it can be done.
Hope it helps!
Upvotes: 0