I have tried to config my log4net to send mail on all info. This is my xml:
<?
xml version="1.0" encoding="utf-8" ?>
<
configuration>
<
configSections>
<
section name="log4net" type= "log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</
configSections>
<
log4net>
<
appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
<
to value="mymail" />
<
from value="[email protected]" />
<
subject value="test logging message" />
<
smtpHost value="smtphost" />
<
Username value="username" />
<
Password value="password" />
<
bufferSize value="512" />
<
lossy value="false" />
<
evaluator type="log4net.Core.LevelEvaluator">
<
threshold value="INFO" />
</
evaluator>
<
layout type="log4net.Layout.PatternLayout,log4net">
<
conversionPattern value="%property{log4net:HostName} :: %level :: %message %newlineLogger: %logger%newlineThread: %thread%newlineDate: %date%newlineNDC: %property{NDC}%newline%newline" />
</
layout>
</
appender>
</
log4net>
<
appSettings>
</
appSettings>
</configuration>
It does not work. Any suggestion how to solve my problem?
Enter your message below
Sign in or Join us (it's free).