logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Logging with Oracle client for .net
Date Mon, 18 Feb 2008 21:44:25 GMT
Have you turned on log4net's internal debugging to see why nothing is being written to the
database?

----- Original Message ----
From: GRESSIER Yoan <Y.GRESSIER@cnr.tm.fr>
To: log4net-dev@logging.apache.org
Sent: Monday, February 18, 2008 12:21:08 PM
Subject: Logging with Oracle client for .net

  
<!--

 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;text-decoration:underline;}
p
	{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:"Times New Roman";}
span.EmailStyle17
	{font-family:Arial;color:windowtext;}
 _filtered {margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
	{}
-->
Hi,
   
 I’m trying to log with the Oracle Data provider
for .net framework, v9.2
   
 I followed the tutorial here : http://logging.apache.org/log4net/release/config-examples.html(Oracle
9i)
   
 My connection type is :
 <connectionType value="Oracle.DataAccess.Client.OracleConnection,
Oracle.DataAccess, Version=9.2.0.401, Culture=neutral,
PublicKeyToken=89b483f429c47342" />
   
 The version and public token is read from the
C:\windows\assembly folder where my oracle.dataaccess.dll is registered
   
 Here is the code of my appender :
   
 <?xml version="1.0" encoding="utf-8" ?>
 <log4net>
   
   <appender name="Inari" type="log4net.Appender.RollingFileAppender">
     <file value="./Logs/inari.log" />
     <appendToFile value="true" />
     <RollingStyle value="Composite" />
     <DatePattern value="yyyyMMdd" />
     <maximumFileSize value="8MB" />
     <maxSizeRollBackups value="10" />
     <layout type="log4net.Layout.PatternLayout">
       <conversionPattern value="%level %date
%-4timestamp {%thread} [%logger] - %message%newline" />
     </layout>
   </appender>
   
   <appender name="InariMetier" type="log4net.Appender.AdoNetAppender">
     <connectionType value="Oracle.DataAccess.Client.OracleConnection,
Oracle.DataAccess, Version=9.2.0.401, Culture=neutral,
PublicKeyToken=89b483f429c47342" />
     <connectionString value="data
source=INARI_D;User ID=INARI;Password=INARIDEV" />
     <commandText value="INSERT INTO
LOGMETIER (LOG_DATE,LOG_THREAD,LOG_LEVEL,LOG_LOGGER,LOG_MESSAGE) VALUES
(:log_date, :thread, :log_level, :logger, :message)" />
     <bufferSize value="128" />
     <parameter>
       <parameterName value=":log_date" />
       <dbType value="DateTime" />
       <layout type="log4net.Layout.RawTimeStampLayout" />
     </parameter>
     <parameter>
       <parameterName value=":thread" />
       <dbType value="String" />
       <size value="255" />
       <layout type="log4net.Layout.PatternLayout">
        
<conversionPattern value="%thread" />
       </layout>
     </parameter>
     <parameter>
       <parameterName value=":log_level" />
       <dbType value="String" />
       <size value="50" />
       <layout type="log4net.Layout.PatternLayout">
        
<conversionPattern value="%level" />
       </layout>
     </parameter>
     <parameter>
       <parameterName value=":logger" />
       <dbType value="String" />
       <size value="255" />
       <layout type="log4net.Layout.PatternLayout">
        
<conversionPattern value="%logger" />
       </layout>
     </parameter>
     <parameter>
       <parameterName value=":message" />
       <dbType value="String" />
       <size value="4000" />
       <layout type="log4net.Layout.PatternLayout">
        
<conversionPattern value="%message" />
       </layout>
     </parameter>
   </appender>
   
   <logger name="Cnr">
     <level value="ALL" />
     <appender-ref ref="Inari" />
     <appender-ref ref="InariMetier" />
   </logger>
   
 </log4net>
 
CREATE TABLE LOGMETIER
 (
   LOG_DATE    
TIMESTAMP(3),
   LOG_THREAD   VARCHAR2(255
BYTE),
   LOG_LEVEL    VARCHAR2(255
BYTE),
   LOG_LOGGER   VARCHAR2(255
BYTE),
   LOG_MESSAGE  VARCHAR2(4000 BYTE)
 )
   
 Loggin in the file inari.log works
fine, but I got no row created in my DB…
      Thanks for help
   Yoan (French Developper) 
      
 
  
<!--

 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;text-decoration:underline;}
p
	{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:"Times New Roman";}
span.EmailStyle17
	{font-family:Arial;color:windowtext;}
 _filtered {margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
	{}
-->



Mime
View raw message