logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Priya <arulpr...@yahoo.com>
Subject Re: ADONetAppender
Date Tue, 02 May 2006 20:35:42 GMT
I still need help please.
  
 
    Hi, the following is the code that I use and I'm unable to write to SQL DB. What am I
missing ??? :(
  Any help would be greatly appreciated. Thanks.
   
  Private logger As ILog
  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
  log4net.Config.XmlConfigurator.Configure()
  logger = LogManager.GetLogger("Log4Net")
  End Sub
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
  If (logger.IsDebugEnabled) Then
  logger.Debug("Debug Logger")
  logger.Info("Info error")
  End if
  End Sub
  <configuration>
  <configSections>
  <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"
/>
  </configSections>
  <log4net debug="True">
  <appender name="AdoNetAppender_SqlServer" type="log4net.Appender.AdoNetAppender">
  <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  <connectionString value="data source=server=SQLEXPRESS;initial catalog=log;integrated
security=false;persist security info=True;User ID=sa;Password=Password" />
  <commandText value="INSERT INTO Log ([Message]) VALUES (@message)" />
  <parameter>
  <parameterName value="@message" />
  <dbType value="String" />
  <size value="4000" />
  <layout type="log4net.Layout.PatternLayout" value="%m" />
  </parameter>
  </appender>
  </log4net>


Mime
View raw message