更改文字描述 优化日志文件名
This commit is contained in:
parent
9743cf1460
commit
86e41f6afb
2 changed files with 6 additions and 6 deletions
|
@ -8,7 +8,7 @@ namespace iFileProxy.Handlers.CommandLine
|
||||||
{
|
{
|
||||||
public void Process()
|
public void Process()
|
||||||
{
|
{
|
||||||
Console.WriteLine("developer logging is enabled.");
|
Console.WriteLine("dev level logging is enabled.");
|
||||||
// 具体的实现在SerilogConfig.cs中 此处仅作提示
|
// 具体的实现在SerilogConfig.cs中 此处仅作提示
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
.WriteTo.Logger(lc => lc
|
.WriteTo.Logger(lc => lc
|
||||||
.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Error)
|
.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Error)
|
||||||
.WriteTo.File(
|
.WriteTo.File(
|
||||||
Path.Combine(baseLogPath, $"{appName}.error.date.log"),
|
Path.Combine(baseLogPath, $"{appName}.error..log"),
|
||||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] {ClientIp} {Message:lj} {contentType} {queryString}{NewLine}{Exception}",
|
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] {ClientIp} {Message:lj} {contentType} {queryString}{NewLine}{Exception}",
|
||||||
rollingInterval: RollingInterval.Day,
|
rollingInterval: RollingInterval.Day,
|
||||||
fileSizeLimitBytes: 1073741824)) // 1GB
|
fileSizeLimitBytes: 1073741824)) // 1GB
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
.WriteTo.Logger(lc => lc
|
.WriteTo.Logger(lc => lc
|
||||||
.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Fatal)
|
.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Fatal)
|
||||||
.WriteTo.File(
|
.WriteTo.File(
|
||||||
Path.Combine(baseLogPath, $"{appName}.fatal.date.log"),
|
Path.Combine(baseLogPath, $"{appName}.fatal..log"),
|
||||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] {ClientIp} {Message:lj} {contentType} {queryString}{NewLine}{Exception}",
|
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] {ClientIp} {Message:lj} {contentType} {queryString}{NewLine}{Exception}",
|
||||||
rollingInterval: RollingInterval.Day,
|
rollingInterval: RollingInterval.Day,
|
||||||
fileSizeLimitBytes: 1073741824)) // 1GB
|
fileSizeLimitBytes: 1073741824)) // 1GB
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
.WriteTo.Logger(lc => lc
|
.WriteTo.Logger(lc => lc
|
||||||
.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Warning)
|
.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Warning)
|
||||||
.WriteTo.File(
|
.WriteTo.File(
|
||||||
Path.Combine(baseLogPath, $"{appName}.warning.date.log"),
|
Path.Combine(baseLogPath, $"{appName}.warning..log"),
|
||||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] {ClientIp} {Message:lj} {contentType} {queryString}{NewLine}{Exception}",
|
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] {ClientIp} {Message:lj} {contentType} {queryString}{NewLine}{Exception}",
|
||||||
rollingInterval: RollingInterval.Day,
|
rollingInterval: RollingInterval.Day,
|
||||||
fileSizeLimitBytes: 1073741824))
|
fileSizeLimitBytes: 1073741824))
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
.WriteTo.Logger(lc => lc
|
.WriteTo.Logger(lc => lc
|
||||||
.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Information)
|
.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Information)
|
||||||
.WriteTo.File(
|
.WriteTo.File(
|
||||||
Path.Combine(baseLogPath, $"{appName}.info.date.log"),
|
Path.Combine(baseLogPath, $"{appName}.info..log"),
|
||||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] {ClientIp} {Message:lj} {contentType} {queryString}{NewLine}{Exception}",
|
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] {ClientIp} {Message:lj} {contentType} {queryString}{NewLine}{Exception}",
|
||||||
rollingInterval: RollingInterval.Day,
|
rollingInterval: RollingInterval.Day,
|
||||||
fileSizeLimitBytes: 1073741824))
|
fileSizeLimitBytes: 1073741824))
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
.WriteTo.Logger(lc => lc
|
.WriteTo.Logger(lc => lc
|
||||||
.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Debug)
|
.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Debug)
|
||||||
.WriteTo.File(
|
.WriteTo.File(
|
||||||
Path.Combine(baseLogPath, $"{appName}.debug.date.log"),
|
Path.Combine(baseLogPath, $"{appName}.debug..log"),
|
||||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] {ClientIp} {Message:lj} {contentType} {queryString}{NewLine}{Exception}",
|
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] {ClientIp} {Message:lj} {contentType} {queryString}{NewLine}{Exception}",
|
||||||
rollingInterval: RollingInterval.Day,
|
rollingInterval: RollingInterval.Day,
|
||||||
fileSizeLimitBytes: 1073741824))
|
fileSizeLimitBytes: 1073741824))
|
||||||
|
|
Loading…
Reference in a new issue