mikebai.com

  • Home
  • dev
  • DotNET
  • M365
  • 搞笑
  • 杂七杂八
  • FocusDict
個人BLOG
it developer
  1. Main page
  2. DotNET
  3. Main content

The Log4net log records to the Oracle 11g

2016-07-01 119hotness 0likes 0comments


Tried many times, the current Log4net does not support the log to Oracle 11g database, so a variety of search. 
1 download the log4net source code is rewritten
    1.1 add a reference to Oracle.DataAccess
    1.2 add OracleAppender  Click here to download
    Can also click here to download the compiled log4net.dll
2 new Web project, add a reference to the log4net.dll and Oracle.DataAccess.dll, and the Web.config configuration
    The 2.1 increase in section
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

       The 2.2 increase in log4net configuration

<log4net>
<appender name="OracleAppender" type="log4net.Appender.OracleAppender">
<bufferSize value="1" />
<connectionType value="Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess, Version=4.113.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
<connectionString value="DATA SOURCE= database TNSNAME; USER ID= user name PASSWORD= password;"/>
<commandText value="INSERT INTO LOG4NET (LOG_ID, LOG_DATE, LOG_LEVEL, LOG_IDENTITY, LOG_MESSAGE, LOG_EXCEPTION, LOG_LOGGER, LOG_SOURCE) VALUES (LOG4NET_SEQ.nextval, :log_date, :log_level, :log_identity, :log_message, :log_exception, :logger, :source)" />
<parameter>
<parameterName

Tag: Nothing
Last updated:2016-07-01

mikebai

This person is a lazy dog and has left nothing

Like
< Last article
Next article >

COPYRIGHT © 2025 mikebai.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang