Debug 用的,主要是看自己的 log4net 設定對不對。
StringBuilder sb = new StringBuilder();
ILoggerRepository[] repos = LogManager.GetAllRepositories();
foreach( ILoggerRepository repo in repos )
{
sb.AppendLine( "=====" );
sb.AppendLine( string.Format( "{0} - configured={1}", repo.Name, repo.Configured.ToString() );
sb.AppendLine( "Appenders:" );
foreach( IAppender appender in repo.GetAppenders() )
{
sb.AppendLine( string.Format( "\t{0}", appender.Name ) );
}
}
sb.AppendLine( "=====" );
Console.WriteLine( sb.ToString() );
沒有留言:
張貼留言