I have a windows application that uses Log4net
for all Debug log. This has been working fine in local machine. The log folder/files are created in Debug / Release
folders appropriately.
I prepared installation package and installed on an end user machine. Apparently, the software was installed in Program Files (x86)
folder. Application is working fine and it is creating business log files in other folders. But, debug log is never created inside Application installation folder in Program Files.
- How do I ensure the file is created there?
- Is it an Admin task to provide users the read/write access to that folder? Or
- Do I need to change path of Debug logs from Program Files to some other folder where every user may have access?
My config is below
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="Logs\Log_%date{MMddyyyy}.log" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] – %message%newline" />
</layout>
</appender>
<root>
<level value="ALL"/>
<appender-ref ref="RollingFileAppender"/>
</root>
<logger>
<level />
<appender-ref />
</logger>
I have reviewed the answer in the link but it didn't solve my problem. I changed my path to ${ALLUSERSPROFILE}\Logs\Log_%date{MMddyyyy}.log
and the log file didn't show up anywhere