Redirect log4net log in the User Directory

前端 未结 3 1044
轻奢々
轻奢々 2021-02-07 07:55

I have a program that uses log4net. It logs directly in the exe folder.

Now, when passing to station with Windows > XP (Vista, Seven) I observed that the logs are not a

3条回答
  •  暖寄归人
    2021-02-07 08:29

    Instead of ${USERPROFILE} (see answer from moldovanu) you can use ${LOCALAPPDATA} or ${APPDATA}. This writes your log files to the the users AppData folder (local or roaming sub folder).

提交回复
热议问题