Specify directory for Serilog rolling file path

非 Y 不嫁゛ 提交于 2019-12-01 07:36:51

The best place for services to write their logs is %PROGRAMDATA% which, by default, is in C:\ProgramData\.

Try:

<add key="serilog:write-to:RollingFile.pathFormat"
     value="%PROGRAMDATA%\ServerService\Logs\log-{Date}.txt" />

(Program Files is usually considered to be read-only, and writing stuff here will lead to oddities being left behind unexpectedly during uninstall.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!