logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrei Leca" <andrei.l...@rms.ro>
Subject FW: AdoNetAppender: can not read custom properties from LoggingEvent using configuration file
Date Wed, 23 Jul 2008 12:06:04 GMT
I used a extended log using example:      



t.Ext.EventID/cs/src/EventIDLogImpl.cs?view=co .




 I have properties InstanceId that is setted in extended log:  


            LoggingEvent loggingEvent = new


                  LoggingEvent(ThisDeclaringType, Logger.Repository,


message, exc);


            loggingEvent.Properties["InstanceId"] = logData.DCSInstanceId;




 I received error: 


      [6108] log4net:ERROR XmlHierarchyConfigurator: Cannot find Property
[conversionPattern] to set object on




 Where it is the problem? Do you can help me? The logs works correctly if
uses other appender: "log4net.Appender.OutputDebugStringAppender"






I used log4net with following configuration for log4net:






    <appender name="AdoNetAppender_SqlServer"




    <bufferSize value="100"/>


    <connectionType value="System.Data.SqlClient.SqlConnection, System.Data,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />


    <connectionString value="data source=XXX; initial catalog=XXX;
integrated security=false;persist security info=True;User
ID=XXX;Password=XXX" /> 


    <commandText value="[Routine].[usp_InsertLog]" />


    <commandType value="StoredProcedure" />




        <parameterName value="@log_date" />


        <dbType value="DateTime" />


        <layout type="log4net.Layout.RawTimeStampLayout" />






        <parameterName value="@message" />


        <dbType value="String" />


        <size value="4000" />


        <layout type="log4net.Layout.PatternLayout">


        <conversionPattern value="%message" />








          <parameterName value="@instance_id" />


          <dbType value="int32" /> 


          <layout type="Dcs.Log.ProtocolInfoPatternLayout, Dcs.Log" />


          <layout type="log4net.Layout.PatternLayout">


          <conversionPattern value="%P{InstanceId}" />










      <level value="DEBUG" />


      <appender-ref ref="DebugView" />


      <appender-ref ref="AdoNetAppender_SqlServer" /> </root> </log4net>




Have a nice day




View raw message