0
I compiled a console application in c# that has log4net (which is already working normally when I run the app) and configured through Windows Task Scheduler to run the application console every day x hours.
But when it runs the program, the output of the log is not being done, it simply doesn’t log in. I would like to know how to log him even programmed to automatically run in Ask Scheduler, follow my log4net.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<log4net>
<root>
<level value="ALL" />
<appender-ref ref="console" />
<appender-ref ref="file" />
</root>
<appender name="console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<!--<conversionPattern value="%date %level %logger - %message%newline" />-->
<conversionPattern value="%message%newline" />
</layout>
</appender>
<appender name="file" type="log4net.Appender.RollingFileAppender">
<file value="logs/migracaoLog.txt" />
<appendToFile value="false" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="5" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %level %logger - %message%newline" />
</layout>
</appender>
</log4net>
</configuration>
this is the application configuration file?
– Ricardo Pontual
No, this is log4net.config is log4net’s configuration file
– Leonardo Bonetti
got it, are you sure it can’t be permission problem? the user who is setting to runs the application has write permission in the folder?
– Ricardo Pontual