Friday, May 18, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: FW: AdoNetAppender: can not read custom properties from LoggingEvent using configuration file
Prev Next
You are not authorized to post a reply.

Author Messages
Andrei Leca

07/23/2008 2:06 PM  

I used a extended log using example:     

 http://svn.apache.org/viewvc/logging/log4net/trunk/extensions/net/1.0/log4ne

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, Logger.Name,

                                                              Level.Info, message, exc);

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

             Logger.Log(loggingEvent);

  I received error:

       󟪌] log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [conversionPattern] to set object on [log4net.Appender.AdoNetAppenderParameter]

 

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

 

 I used log4net 1.2.10.0(windows) with following configuration for log4net:

 

<log4net>

    <appender name="AdoNetAppender_SqlServer"

 type="log4net.Appender.AdoNetAppender">

     <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" />

     <parameter>

         <parameterName value="@log_date" />

         <dbType value="DateTime" />

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

     </parameter>

     <parameter>

         <parameterName value="@message" />

         <dbType value="String" />

        <size value="4000" />

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

         <conversionPattern value="%message" />

         </layout>

     </parameter>

     <parameter>

           <parameterName value="@instance_id" />

           <dbType value="int32" />

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

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

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

     </parameter>

 </appender>

 <root>

       <level value="DEBUG" />

       <appender-ref ref="DebugView" />

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

 

Have a nice day

 

Andy

 

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > FW: AdoNetAppender: can not read custom properties from LoggingEvent using configuration file



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement