Description
If the calling application does not have the PathDiscovery FileIOPermission a SecurityException is generated from the XmlConfiguratorAttribute.Configure method. This is called from the first LoggerManager.GetLogger in a calling assembly.
The exception should be caught as we may potentially be injecting this exception into user code's class initialisation phase which the user would find unexpected.
An example stack trace for the exception is:
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +59
System.AppDomainSetup.VerifyDir(String dir, Boolean normalize) +110
System.AppDomain.get_BaseDirectory() +61
log4net.Util.SystemInfo.get_ApplicationBaseDirectory() +31
log4net.Config.XmlConfiguratorAttribute.Configure(Assembly sourceAssembly, ILoggerRepository targetRepository) +30
log4net.Core.DefaultRepositorySelector.ConfigureRepository(Assembly assembly, ILoggerRepository repository) +314
log4net.Core.DefaultRepositorySelector.CreateRepository(Assembly repositoryAssembly, Type repositoryType, String repositoryName, Boolean readAssemblyAttributes) +532
log4net.Core.DefaultRepositorySelector.CreateRepository(Assembly repositoryAssembly, Type repositoryType) +42
log4net.Core.DefaultRepositorySelector.GetRepository(Assembly repositoryAssembly) +80
log4net.Core.LoggerManager.GetLogger(Assembly repositoryAssembly, String name) +132
log4net.LogManager.GetLogger(Assembly repositoryAssembly, String name) +30
log4net.LogManager.GetLogger(String name) +34