I created a new .NET Core web project using Visual Studio and integrated Serilog. It reads settings from the appsettings.json (via .UseSerilog((ctx, config) => { config.ReadFrom.Configuration(ctx.Configuration); })
).
In the appsettings.json, the path to write the log is specified at Serilog/WriteTo/Args/pathFormat
. If I set that value to log.txt
, it will attempt to write the file to `c:\program files\iisexpress\log.txt'.
How can I get it to write to the content root of my web app?