How to disable creation of empty log file on app start?

前端 未结 7 822
生来不讨喜
生来不讨喜 2020-11-30 07:04

I have configured log4net in my app successfully but one thing is a little bit annoying for me.

The log file is created (empty) after my app start even if no error o

7条回答
  •  没有蜡笔的小新
    2020-11-30 07:21

    The problem with that approach is that then if the file exists but is read-only, or is in a directory which doesn't exist etc, you won't find out until another error is already causing problems. You really want to be confident that logging is working before the rest of the app starts.

    There may be a way of doing this anyway, but if not I suspect that this is the reason.

提交回复
热议问题