I created a unit test and got some debug info back finally but I'm unclear why it's happening. I'm calling Configure in my utility class -> public LogUtility() { log4net.Config.XmlConfigurator.Configure(); log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); }
LogUtilityTests.LoggerIsSuccessful : Passedlog4net: log4net assembly [log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821]. Loaded from [Global Assembly Cache]. (.NET Runtime [2.0.50727.3053] on Microsoft Windows NT 5.1.2600 Service Pack 2) log4net: log4net assembly [log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821]. Loaded from [Global Assembly Cache]. (.NET Runtime [2.0.50727.3053] on Microsoft Windows NT 5.1.2600 Service Pack 2) log4net: DefaultRepositorySelector: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy] log4net: DefaultRepositorySelector: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy] log4net: DefaultRepositorySelector: Creating repository for assembly [Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] log4net: DefaultRepositorySelector: Creating repository for assembly [Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] log4net: DefaultRepositorySelector: Assembly [Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Documents and Settings\user\Local Settings\Temp\tpo4otwu.afk\Common.Test\assembly\dl3\276e0687\2c87db19_ed4fc901\Common.DLL] log4net: DefaultRepositorySelector: Assembly [Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Documents and Settings\user\Local Settings\Temp\tpo4otwu.afk\Common.Test\assembly\dl3\276e0687\2c87db19_ed4fc901\Common.DLL] log4net: DefaultRepositorySelector: Assembly [Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified. log4net: DefaultRepositorySelector: Assembly [Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified. log4net: DefaultRepositorySelector: Assembly [Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy] log4net: DefaultRepositorySelector: Assembly [Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy] log4net: DefaultRepositorySelector: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy] log4net: DefaultRepositorySelector: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy] log4net: XmlConfigurator: configuring repository [log4net-default-repository] using .config file section log4net: XmlConfigurator: configuring repository [log4net-default-repository] using .config file section log4net: XmlConfigurator: Application config file is [C:\Documents and Settings\user\My Documents\Visual Studio 2008\Projects\project1\Common.Test\bin\Debug\Common.Test.dll.config] log4net: XmlConfigurator: Application config file is [C:\Documents and Settings\user\My Documents\Visual Studio 2008\Projects\project1\Common.Test\bin\Debug\Common.Test.dll.config] log4net:ERROR XmlConfigurator: Failed to parse config file. Is the <configSections> specified as: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" /> log4net:ERROR XmlConfigurator: Failed to parse config file. Is the <configSections> specified as: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" /> System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for log4net: Could not load file or assembly 'log4net' or one of its dependencies. The system cannot find the file specified. (C:\Documents and Settings\user\My Documents\Visual Studio 2008\Projects\project1\Common.Test\bin\Debug\Common.Test.dll.config line 5) ---> System.IO.FileNotFoundException: Could not load file or assembly 'log4net' or one of its dependencies. The system cannot find the file specified. File name: 'log4net' at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError) at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord) at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord) at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory..ctor(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord) at System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord) at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere) === Pre-bind state information === LOG: User = domain\user LOG: DisplayName = log4net (Partial) LOG: Appbase = file:///C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/project1/Common.Test/bin/Debug LOG: Initial PrivatePath = NULL Calling assembly : System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Documents and Settings\user\My Documents\Visual Studio 2008\Projects\project1\Common.Test\bin\Debug\Common.Test.dll.config LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/project1/Common.Test/bin/Debug/log4net.DLL. LOG: Attempting download of new URL file:///C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/project1/Common.Test/bin/Debug/log4net/log4net.DLL. LOG: Attempting download of new URL file:///C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/project1/Common.Test/bin/Debug/log4net.EXE. LOG: Attempting download of new URL file:///C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/project1/Common.Test/bin/Debug/log4net/log4net.EXE. --- End of inner exception stack trace --- at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName) at System.Configuration.ConfigurationManager.GetSection(String sectionName) at log4net.Config.XmlConfigurator.Configure(ILoggerRepository repository) System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for log4net: Could not load file or assembly 'log4net' or one of its dependencies. The system cannot find the file specified. (C:\Documents and Settings\user\My Documents\Visual Studio 2008\Projects\project1\Common.Test\bin\Debug\Common.Test.dll.config line 5) ---> System.IO.FileNotFoundException: Could not load file or assembly 'log4net' or one of its dependencies. The system cannot find the file specified. File name: 'log4net' at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError) at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord) at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord) at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory..ctor(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord) at System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord) at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere) === Pre-bind state information === LOG: User = domain\user LOG: DisplayName = log4net (Partial) LOG: Appbase = file:///C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/project1/Common.Test/bin/Debug LOG: Initial PrivatePath = NULL Calling assembly : System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Documents and Settings\user\My Documents\Visual Studio 2008\Projects\project1\Common.Test\bin\Debug\Common.Test.dll.config LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/project1/Common.Test/bin/Debug/log4net.DLL. LOG: Attempting download of new URL file:///C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/project1/Common.Test/bin/Debug/log4net/log4net.DLL. LOG: Attempting download of new URL file:///C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/project1/Common.Test/bin/Debug/log4net.EXE. LOG: Attempting download of new URL file:///C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/project1/Common.Test/bin/Debug/log4net/log4net.EXE. --- End of inner exception stack trace --- at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName) at System.Configuration.ConfigurationManager.GetSection(String sectionName) at log4net.Config.XmlConfigurator.Configure(ILoggerRepository repository) -- View this message in context: http://www.nabble.com/configuration-problems%2C-not-logging-tp20688643p20705784.html Sent from the Log4net - Users mailing list archive at Nabble.com.