Log4Net Configuration Schema error for 1.2.9 version while running on windows services #219
Closed
mahadevblore
started this conversation in
General
Replies: 2 comments 14 replies
-
@mahadevblore can you post your config file? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Sorry, I thought I had put the config file contents in the discussion thread. Here we go: <?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
</sectionGroup>
<sectionGroup name="EncryptionSettings">
<section name="EncryptionConfig" type="System.Configuration.NameValueSectionHandler,system,Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089,Custom=null"/>
<section name="PGPConfig" type="System.Configuration.NameValueSectionHandler,system,Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089,Custom=null"/>
<section name="PGPErrorCodes" type="System.Configuration.NameValueSectionHandler,system,Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089,Custom=null"/>
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<appSettings>
</appSettings>
<log4net>
<root>
<level value="ALL" />
<appender-ref ref="RollingLogFileAppender" />
<appender-ref ref="LogFileAppender" />
</root>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<level value="ALL" />
<file value="logs\\OutgoingFileMgmt.log" />
<appendToFile value="true" />
<maxSizeRollBackups value="4" />
<maximumFileSize value="10MB" />
<rollingStyle value="Size" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
" />
<footer value="[Footer]
" />
<conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
</layout>
</appender>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<file value="logs\\OutgoingFileMgmt.xml" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
" />
<footer value="[Footer]
" />
<conversionPattern value="%date [%thread] %-5level %logger [%ndc] <%property{auth}> - %message%newline" />
</layout>
<layout type="log4net.Layout.XMLLayout" />
</appender>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Net.Sockets">
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
<source name="System.Net">
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="MyTraceFile"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="logs\SshNetTrace.log"/>
</sharedListeners>
<switches>
<add name="System.Net" value="Verbose" />
<add name="System.Net.Sockets" value="Verbose" />
</switches>
</system.diagnostics>
</configuration> |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a windows service which is written in C# and uses the log4net 1.2.9 for logging.
While trying to start the application from services, we get the following error:
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Configuration.ConfigurationErrorsException
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(System.Configuration.ConfigurationSchemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(System.String)
Exception Info: System.Configuration.ConfigurationErrorsException
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(System.String)
at System.Configuration.PrivilegedConfigurationManager.GetSection(System.String)
at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.DiagnosticsConfiguration.get_IndentSize()
at System.Diagnostics.TraceInternal.InitializeSettings()
at System.Diagnostics.TraceInternal.WriteLine(System.String)
at log4net.Util.LogLog.EmitErrorLine(System.String)
at log4net.Util.LogLog.Error(System.String, System.Exception)
at log4net.Util.LogLog..cctor()
Exception Info: System.TypeInitializationException
at log4net.Util.LogLog.Debug(System.String)
at log4net.Core.LoggerManager..cctor()
Exception Info: System.TypeInitializationException
at log4net.Core.LoggerManager.GetRepository(System.Reflection.Assembly)
at log4net.Config.XmlConfigurator.Configure()
at CustomService.Main(System.String[])
The configuration files has following things for log4net configuration:
The exe name and exe.config files names are the same
customService.exe and customService.exe.config
Any idea why this error is coming up?
I tried multiple things like changing to different config settings by looking at documentation example but none of them checks out.
Please help with this.
NOTE: The code repository is inaccessible so any code changes are not possible at this point of time.
Beta Was this translation helpful? Give feedback.
All reactions