FreeAndNil commented on issue #332:
URL:
https://github.com/apache/logging-log4net/issues/332#issuecomment-5876161077
Hi @WolfgangHG,
thank you for the report and the sample project.
This is an intended change, but your case was not thought about.
In 3.4.0 `OnlyOnceErrorHandler`, the default error handler of every
appender, writes the first error
always. Before it did that only with `log4net.Internal.Debug` on. The
reason: an appender could stop
working and nobody would see it. See the 3.4.0 changelog, "report the first
error of an appender
even when log4net.Internal.Debug is off" (#310).
`XmlConfigurator.ConfigureAndWatch` collects all internal messages and
returns them. So an appender
error is now in that list too, not only errors from the config file. Your
check "list is not empty"
is therefore stricter than before.
`LogLog.EmitInternalMessages = false` does not help, it only stops the
console output.
`log4net.Internal.Quiet` hides every internal error, which you probably do
not want.
Filtering works. Appender errors come from `OnlyOnceErrorHandler`, config
errors from another type:
```csharp
ICollection messages = XmlConfigurator.ConfigureAndWatch(new
FileInfo("..\\..\\..\\Logger4netXML.config"));
List<log4net.Util.LogLog> configErrors = messages
.Cast<log4net.Util.LogLog>()
.Where(m => m.Source != typeof(log4net.Util.OnlyOnceErrorHandler))
.ToList();
if (configErrors.Count > 0)
{
foreach (log4net.Util.LogLog x in configErrors)
{
Console.WriteLine(x);
}
}
```
The appender in your stack trace is not ours, but our own `EventLogAppender`
sends the same message.
Does that solve your problem?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]