Open
Description
I use composite configuration as bellow, it works as expected. but once the app restarts, it will report errors such as bellow:
log4net:ERROR RollingFileAppender: INTERNAL ERROR. Append is False but OutputFile [C:\ProgramData\ApplicationLogs\AtlasCopcoACLog\AC.MTC.Server\20241218.1.log] already exists.
the 20240918.1.log will be overrided
<appender name="LocalFilesAppender" type="log4net.Appender.RollingFileAppender">
<file value="myfolder"/>
<appendToFile value="true" />
<staticLogFileName value="false" />
<DatePattern value="yyyyMMdd'.log'"/>
<!--new file will be created per day or the file size >25MB-->
<rollingStyle value="Composite" />
<!--new file will be created auto once the existing one exceed 25MB-->
<maximumFileSize value="25MB" />
<!--not more than 10 files will be kept-->
<maxSizeRollBackups value="10" />
<preserveLogFileNameExtension value="true"/>
<CountDirection value="1" />
<Encoding value="UTF-8" />
<layout type="AC.ICA.Logger.LogContentLayout,AC.ICA.Logger">
<conversionPattern value="%date{HH:mm:ss.fff}|%acprop{Level}|%acprop{DeviceName}|%acprop{Logger}|%acprop{Source}|%acprop{Message}%newline"/>
</layout>
</appender>
Metadata
Assignees
Labels
No labels