Specify directory for Serilog rolling file path
问题 Consider this app.config appSetting entry: <add key="serilog:write-to:RollingFile.pathFormat" value="ServerServiceApp-{Date}.log" /> This is done at app startup: Log.Logger = new LoggerConfiguration() .ReadFrom.AppSettings() .Enrich.WithThreadId() .CreateLogger(); This is in a Windows service app. The log file ends up here: C:\Windows\SysWOW64 Clearly, we’d rather have the log file end up in the same directory that houses this service’s .exe (customers don’t want us writing stuff to SysWOW64)