如何使用Log4net日志记录解决异常

时间:2018-12-10 20:46:47

标签: log4net

I am getting following exceptions when debugging console app with Log4 net
:

“ System.Configuration.ConfigurationErrorsException:配置系统无法初始化--->     System.Configuration.ConfigurationErrorsException:无法识别的配置节客户端。 (     D:\ Agilent-Jasmeen \ b.01.01-ap \ Portal \ TriggerAPDataRemediation \ TriggerAPDataRemediation \ bin \ Debug \ TriggerAPDataRemediation.vshost.exe.config第13行)        在System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)        在System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)        在System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()        在System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)        ---内部异常堆栈跟踪的结尾---        在System.Configuration.ConfigurationManager.PrepareConfigSystem()        在System.Configuration.ConfigurationManager.GetSection(String sectionName)        在System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)        在System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()        在System.Diagnostics.DiagnosticsConfiguration.Initialize()        在System.Diagnostics.DiagnosticsConfiguration.get_IndentSize()        在System.Diagnostics.TraceInternal.InitializeSettings()        在System.Diagnostics.TraceInternal.WriteLine(字符串消息)        在log4net.Util.LogLog.EmitErrorLine(字符串消息)     log4net:ERROR读取ConfigurationSettings时发生异常。检查您的.config文件格式是否正确。     System.Configuration.ConfigurationErrorsException:配置系统无法初始化---> System.Configuration.ConfigurationErrorsException:无法识别的配置节客户端。 (D:\ Agilent-Jasmeen \ b.01.01-ap \ Portal \ TriggerAPDataRemediation \ TriggerAPDataRemediation \ bin \ Debug \ TriggerAPDataRemediation.vshost.exe.config第13行)        在System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)        在System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)        在System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()        在System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)        ---内部异常堆栈跟踪的结尾---        在System.Configuration.ConfigurationManager.PrepareConfigSystem()        在System.Configuration.ConfigurationManager.get_AppSettings()        在log4net.Util.SystemInfo.GetAppSetting(字符串键)     log4net:ERROR读取ConfigurationSettings时发生异常。检查您的.config文件格式是否正确。     System.Configuration.ConfigurationErrorsException:配置系统无法初始化---> System.Configuration.ConfigurationErrorsException:无法识别的配置节客户端。 (D:\ Agilent-Jasmeen \ b.01.01-ap \ Portal \ TriggerAPDataRemediation \ TriggerAPDataRemediation \ bin \ Debug \ TriggerAPDataRemediation.vshost.exe.config第13行)        在System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)        在System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)        在System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()        在System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)        ---内部异常堆栈跟踪的结尾---        在System.Configuration.ConfigurationManager.PrepareConfigSystem()        在System.Configuration.ConfigurationManager.get_AppSettings()        在log4net.Util.SystemInfo.GetAppSetting(字符串键)     log4net:ERROR读取ConfigurationSettings时发生异常。检查您的.config文件格式是否正确。     System.Configuration.ConfigurationErrorsException:配置系统无法初始化---> System.Configuration.ConfigurationErrorsException:无法识别的配置节客户端。 (D:\ Agilent-Jasmeen \ b.01.01-ap \ Portal \ TriggerAPDataRemediation \ TriggerAPDataRemediation \ bin \ Debug \ TriggerAPDataRemediation.vshost.exe.config第13行)        在System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)        在System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)        在System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()        在System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)        ---内部异常堆栈跟踪的结尾---        在System.Configuration.ConfigurationManager.PrepareConfigSystem()        在System.Configuration.ConfigurationManager.get_AppSettings()        在log4net.Util.SystemInfo.GetAppSetting(字符串键)     log4net:ERROR读取ConfigurationSettings时发生异常。检查您的.config文件格式是否正确。     System.Configuration.ConfigurationErrorsException:配置系统无法初始化---> System.Configuration.ConfigurationErrorsException:无法识别的配置节客户端。 (D:\ Agilent-Jasmeen \ b.01.01-ap \ Portal \ TriggerAPDataRemediation \ TriggerAPDataRemediation \ bin \ Debug \ TriggerAPDataRemediation.vshost.exe.config第13行)        在System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)        在System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)        在System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()        在System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)        ---内部异常堆栈跟踪的结尾---        在System.Configuration.ConfigurationManager.PrepareConfigSystem()        在System.Configuration.ConfigurationManager.get_AppSettings()        在log4net.Util.SystemInfo.GetAppSetting(字符串键)     log4net:ERROR读取ConfigurationSettings时发生异常。检查您的.config文件格式是否正确。     System.Configuration.ConfigurationErrorsException:配置系统无法初始化---> System.Configuration.ConfigurationErrorsException:无法识别的配置节客户端。 (D:\ Agilent-Jasmeen \ b.01.01-ap \ Portal \ TriggerAPDataRemediation \ TriggerAPDataRemediation \ bin \ Debug \ TriggerAPDataRemediation.vshost.exe.config第13行)        在System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)        在System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)        在System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()        在System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)        ---内部异常堆栈跟踪的结尾---        在System.Configuration.ConfigurationManager.PrepareConfigSystem()        在System.Configuration.ConfigurationManager.get_AppSettings()        在log4net.Util.SystemInfo.GetAppSetting(字符串键)     log4net:ERROR读取ConfigurationSettings时发生异常。检查您的.config文件格式是否正确。     System.Configuration.ConfigurationErrorsException:配置系统无法初始化---> System.Configuration.ConfigurationErrorsException:无法识别的配置节客户端。 (D:\ Agilent-Jasmeen \ b.01.01-ap \ Portal \ TriggerAPDataRemediation \ TriggerAPDataRemediation \ bin \ Debug \ TriggerAPDataRemediation.vshost.exe.config第13行)        在System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)        在System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)        在System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()        在System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)        ---内部异常堆栈跟踪的结尾---        在System.Configuration.ConfigurationManager.PrepareConfigSystem()        在System.Configuration.ConfigurationManager.get_AppSettings()        在log4net.Util.SystemInfo.GetAppSetting(字符串键)   “

0 个答案:

没有答案