Using below code in appsettings.json file for generating serilog daily
"rollingInterval": "Day",
It is generating .txt in path with below format
20210414.txt
how to generated .txt in path with this format
14Apr2021.txt
Using below code in appsettings.json file for generating serilog daily
"rollingInterval": "Day",
It is generating .txt in path with below format
20210414.txt
how to generated .txt in path with this format
14Apr2021.txt
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Naimish MakwanaRank #324 · 7.7K reputationPosted Apr 21, 2023, 3:24 AM EDT
Try below:
{ "Serilog": { "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ], "MinimumLevel": "Information", "WriteTo": [ { "Name": "Console" }, { "Name": "File", "Args": { "path": "Logs\\log-.txt", "rollingInterval": "Day", "outputTemplate": "{Timestamp:ddMMMyyyy}.txt" } } ] } }Thanks