I have the following .Net Core – appsetting. It writes the log but writes multiple log files.
Like this: How can I get write a single file every hour? thx!! Help!
log-2024080512_001.txt 8/5 12:25
log-2024080512_002.txt 8/5 12:19
log-2024080512.txt 8/5 12:03
**My Appsetting looks like this**
{
"Serilog": {
"Using": ["Serilog.Sinks.File"],
"MinimumLevel": "Information",
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "./logs/log-.txt",
"rollingInterval": "Hour",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"
}
}
],
"Enrich": ["FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId"]
}
}