I'm trying to use the log4net in my c# ASP.net Core 2.2 app but when I use any of these patterns they give me output with question marks.
My log4net.config:
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="C:\Temp\app.log" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date | %level | [%thread] | %type %method %line - %message%n" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="RollingFile" />
</root>
</log4net>
the file looks like this after a log is written:
2019-04-17 11:48:44,230 | INFO | [1] | ? ? ? - abc
any idea why this is happening and how to fix this? I saw some tutorials that use these patterns and tried to copy from them but the results were the same... maybe something in my configuration is wrong?
from here I understand that I can just add the file name and line to my message but I wanted to try a fix in the config file first.
thanks.