我使用最新的VS2017创建了一个新的ASP.NET Core WebAPI项目。
记录器会截断所有行,因此消息完全没用。
我找不到禁用它的方法。
这就是我所拥有的(使用serilog文件记录器):
启动
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
loggerFactory.AddFile("bin\\Debug\\server.log", LogLevel.Debug);
app.UseMvc();
}
的AppSettings:
{
"Logging": {
"IncludeScopes": true,
"LogLevel": {
"Default": "Info"
}
}
}
这就是我得到的(控制台)
Hosting environment: Development
Content root path: D:\Daten\ASP\EBK\src\Kollektor
Now listening on: http://X:8000
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Server.Kestrel[17]
Connection id "0HL4SRDM7TAGL" bad request data: "Invalid request line: GET /kollektor/api/datapoints HT..."
Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException: Invalid request line: GET /kollektor/api/datapoints HT...
这就是我得到的(文件记录器)
2017-05-17T06:15:59.8697799+02:00 [INF] Connection id ""0HL4SRDM7TAGL"" bad request data: ""Invalid request line: GET /kollektor/api/datapoints HT..."" (86f1a409)
Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException: Invalid request line: GET /kollektor/api/datapoints HT...
我缺少什么设置?