in src/log4net/Repository/Hierarchy/Logger.cs [556:618]
protected virtual void CallAppenders(LoggingEvent loggingEvent)
{
if (loggingEvent == null)
{
throw new ArgumentNullException("loggingEvent");
}
int writes = 0;
for(Logger c=this; c != null; c=c.m_parent)
{
if (c.m_appenderAttachedImpl != null)
{
// Protected against simultaneous call to addAppender, removeAppender,...
c.m_appenderLock.AcquireReaderLock();
try
{
if (c.m_appenderAttachedImpl != null)
{
writes += c.m_appenderAttachedImpl.AppendLoopOnAppenders(loggingEvent);
}
}
finally
{
c.m_appenderLock.ReleaseReaderLock();
}
}
if (!c.m_additive)
{
break;
}
}
// No appenders in hierarchy, warn user only once.
//
// Note that by including the AppDomain values for the currently running
// thread, it becomes much easier to see which application the warning
// is from, which is especially helpful in a multi-AppDomain environment
// (like IIS with multiple VDIRS). Without this, it can be difficult
// or impossible to determine which .config file is missing appender
// definitions.
//
if (!m_hierarchy.EmittedNoAppenderWarning && writes == 0)
{
m_hierarchy.EmittedNoAppenderWarning = true;
LogLog.Debug(declaringType, "No appenders could be found for logger [" + Name + "] repository [" + Repository.Name + "]");
LogLog.Debug(declaringType, "Please initialize the log4net system properly.");
try
{
LogLog.Debug(declaringType, " Current AppDomain context information: ");
LogLog.Debug(declaringType, " BaseDirectory : " + SystemInfo.ApplicationBaseDirectory);
#if !NETCF && !NETSTANDARD1_3
LogLog.Debug(declaringType, " FriendlyName : " + AppDomain.CurrentDomain.FriendlyName);
LogLog.Debug(declaringType, " DynamicDirectory: " + AppDomain.CurrentDomain.DynamicDirectory);
#endif
}
catch(System.Security.SecurityException)
{
// Insufficient permissions to display info from the AppDomain
}
}
}