Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set property [file] on object [log4net.Appender.FileAppender] #220

Open
moxiaxue opened this issue Dec 23, 2024 · 0 comments
Open

Comments

@moxiaxue
Copy link

moxiaxue commented Dec 23, 2024

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant