Clog Fatal: DanielVaughan.Logging.ClientLoggingException: Configuration Error: LogStrategy is missing or of wrong type

Oct 22, 2010 at 2:32 PM

Hi,

 I am using clog and my configuration section reads as

  <Clog InternalLogLevel="All" SkipFrameCount="4" xmlns="http://danielvaughan.orpius.com/Clog/2/0/">
    <LogStrategy Name="Simple" Type="ExampleWebsite.SimpleLogStrategy, ExampleWebsite">
      <Filter Name="IPAddressRange" Type="DanielVaughan.Logging.Filters.IPAddressRangeFilter, DanielVaughan.Logging" Begin="127.0.0.0" End="127.0.0.10"/>
    </LogStrategy>
    <LogStrategy Name="Log4Net" Type="DanielVaughan.Logging.LogStrategies.Log4NetStrategy, DanielVaughan.Logging.Log4NetLogStrategy">
      <Filter Name="IPAddressRange" Type="DanielVaughan.Logging.Filters.IPAddressRangeFilter, DanielVaughan.Logging" Begin="127.0.0.0" End="127.0.0.10"/>
    </LogStrategy>
  </Clog>
  <log4net debug="true">
    <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="D:\\TestApp\\UI\\Test.txt"/>
      <param name="AppendToFile" value="true"/>
      <layout type="log4net.Layout.PatternLayout">
        <staticLogFileName value="true"/>
        <param name="Header" value=""/>
        <param name="Footer" value=""/>
        <param name="ConversionPattern" value="%d [%t] %-5p %m%n"/>
      </layout>
    </appender>
    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
      <layout type="log4net.Layout.PatternLayout">
        <param name="Header" value="[Header]\r\n"/>
        <param name="Footer" value="[Footer]\r\n"/>
        <param name="ConversionPattern" value="%d [%t] %-5p %m%n"/>
      </layout>
    </appender>
    <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
      <layout type="log4net.Layout.PatternLayout">
        <param name="Header" value="[Header]\r\n"/>
        <param name="Footer" value="[Footer]\r\n"/>
        <param name="ConversionPattern" value="%d [%t] %-5p %m%n"/>
      </layout>
    </appender>
    <root>
      <level value="All"/>
      <!--<appender-ref ref="LogFileAppender" />
      <appender-ref ref="ConsoleAppender" />-->
      <appender-ref ref="RollingLogFileAppender"/>
    </root>
  </log4net>

After runing the service and loging the logs from silverlight client application. There are few exception comming and loging to Application event viewer.

1) Clog Fatal: DanielVaughan.Logging.ClientLoggingException: Configuration Error: LogStrategy is missing or of wrong type. Name: System.Configuration.ConfigXmlAttributeException: System.ArgumentNullException: Value cannot be null.

Parameter name: type

at System.Activator.CreateInstance(Type type, Boolean nonPublic)

at System.Activator.CreateInstance(Type type)

at DanielVaughan.Logging.Configuration.LogRepository.Load(XmlElement rootElement)

at DanielVaughan.Logging.Configuration.LogRepository.Load(XmlElement rootElement)

at DanielVaughan.Logging.Log.InitFromConfig()

at DanielVaughan.Logging.Log..cctor() Configuration Error: LogStrategy is missing or of wrong type. Name: System.Configuration.ConfigXmlAttributeException: System.ArgumentNullException: Value cannot be null.

Parameter name: type

at System.Activator.CreateInstance(Type type, Boolean nonPublic)

at System.Activator.CreateInstance(Type type)

at DanielVaughan.Logging.Configuration.LogRepository.Load(XmlElement rootElement) at DanielVaughan.Logging.Configuration.LogRepository.Load(XmlElement rootElement)

at DanielVaughan.Logging.Log.InitFromConfig()

at DanielVaughan.Logging.Log..cctor()

For more information, see Help and Support Center at

2)  Clog Fatal:Unable to init from config.

3) Clog Error: System.ArgumentNullException: Value cannot be null.

Parameter name: type

at System.Activator.CreateInstance(Type type, Boolean nonPublic)

at System.Activator.CreateInstance(Type type)

at DanielVaughan.Logging.Configuration.LogRepository.Load(XmlElement rootElement) Value cannot be null.

4) Clog Error:LogStrategy is missing or of wrong type. Name: System.Configuration.ConfigXmlAttribute

 

Please guide me with the appropriate solution.

Thanks in advance.

Jay

 

Oct 25, 2010 at 4:09 PM

Hi Daniel,

I have mathed all the details and configuration file and every thing looks fine. I am using the 1.3.0.0 version of DanielVaughan.Logging.Log4NetLogStrategy dll.

Please suggest, is it the latest version or do I need to change something else.

Thanks for a reply.

Cheers

Jay