Title: RE: ADO.NET appender parameters

Thanks for that, the property example was just what I was looking for. Being new to log4net I wasn't sure how to set it up/use it. Keep up the excellent work.

-----Original Message-----
From: Ron Grabowski [mailto:[EMAIL PROTECTED]]
Sent: 18 February 2006 00:15
To: Log4NET User
Subject: Re: ADO.NET appender parameters

What exactly do you want to send?

This is the example from the website:

 <parameter>
  <parameterName value="@thread" />
  <dbType value="String" />
  <size value="255" />
  <layout type="log4net.Layout.PatternLayout">
   <conversionPattern value="%thread" />
  </layout>
 </parameter>

Here's an example of how to send data using a property:

 log4net.GlobalContext.Properties["Today"] = DateTime.Today;
 log.Debug("this is my message");

 <parameter>
  <parameterName value="@today" />
  <dbType value="Date" />
  <layout type="log4net.Layout.PatternLayout">
   <conversionPattern value="%property{Today}" />
  </layout>
 </parameter>

--- "Coates, Anthony" <[EMAIL PROTECTED]> wrote:

> Hi
>
> I would like to perform some logging with the AdoNetAppender using
> custom
> parameters and values (i.e. not just using a built in value like
> %thread) so
> that I can, in effect, send several user defined messages (other than
> just
> %message) to separate parameters of the stored procedure with a log.
> I've
> noticed in a recent mail the use of
> loggingEvent.Properties["@textData1"] =
> "some string" but am not sure how I can get hold of the loggingEvent
> prior
> to calling the logger (if that's how it's done). Any suggestions with
> example code & config would be much appreciated.
>

>
> Cheers
>
> Ant
>
>
>
> Scanned for viruses by BlackSpider MailControl. The integrity and
> security of this message cannot be guaranteed. This email is intended
> for the named recipient only, and may contain confidential
> information and proprietary material. Any unauthorised use or
> disclosure is prohibited.
>



Scanned for viruses by BlackSpider MailControl. The integrity and security of this message cannot be guaranteed. This email is intended for the named recipient only, and may contain confidential information and proprietary material. Any unauthorised use or disclosure is prohibited.

Reply via email to