|
Harry, Inserting custom data using the AdoNetAppender si pretty
straight forward, first you have to modify the sql statement in the
configuration file to something like: <commandText value="INSERT INTO Log4Net
([Date],[Thread],[Level],[Logger],[Me And add a new parameter definition for the custom column
for example like: <parameter>
<parameterName value="@HostName"/>
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{MyColumn}" />
</layout> </parameter> Then you use one of log4net’s contexts to transfer
values to the parameter for example: log4net.GlobalContext.Properties["MyColumn"] = "MyValue"; log.Debug("My me Best regards Georg http://www.l4ndash.com - Log4net Dashboard -----Original Me Hello, I am trying to find a way to write my own custom parameters that I
would log to a SQL Server Database. I am a newbie to this, so I got
the "out-of-the-box" implementation of logging an exception, me that writes to SQL Server using the ADONetAppender. However, I want to
pa own custom data variables to the database. So, my DB table would
have these fields: Table name = CustomStuff Custom Log Fields: MyCustomMe MyCustomContactName MyCustomPhoneNumber I found code that creates a custom ADONetAppender, but there's more to
it and I can seem to bridge even how that would translate into C# code on
how to pa I hope what I am asking makes sense, but if not I can provide more
details. Thanks in advance, Harry The contents of this email are the property of PNC. If it was not addre |
- Using log4net with web services Adriano Labate
- RE: Using log4net with web services Dean Fiala
- RE: Using log4net with web services Adriano Labate
- How to pass data to custom ADONetAppender parameters... harry . douglass
- RE: How to pass data to custom ADONetAppender pa... Georg Jansen
