List Info

Thread: RE: Logging with Oracle client for .net




RE: Logging with Oracle client for .net
country flaguser name
France
2008-02-19 02:00:59

Yes i’ve, there is nothing written on the output.

 

I’ve found the answers, hope this help’;s someone :

  • My application use several user, one is the schemaR17;s owner, the other is the application user. So, my command text was wrong :

 

<commandText value="INSERT INTO GEN$INARI.LOGMETIER (LOG_DATE,LOG_THREAD,LOG_LEVEL,LOG_LOGGER,LOG_MESSAGE) VALUES (:log_date, :thread, :log_level, :logger, :message)" />

 

I have to specify the schemaR17;s name in my command text

 

Then, I put the buffer size to 1 :

<bufferSize value="1" />

And now, it works !...

Thanks for your answer

 

 


De : Ron Grabowski [mailto:rongrabowskiyahoo.com]
Envoyé&nbsp;: lundi 18 févr
ier 2008 22:44
À : Log4NET Dev
Objet ;: Re: Logging with Oracle client for .net

 

Have you turned on log4net's internal debugging to see why nothing is being written to the database?

----- Original Message ----
From: GRESSIER Yoan <Y.GRESSIERcnr.tm.fr&gt;
To: log4net-devlogging.apache.org
Sent: Monday, February 18, 2008 12:21:08 PM
Subject: Logging with Oracle client for .net

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&quot; />

 

The version and public token is read from the C:windowsassembly folder where my oracle.dataaccess.dll is registered

 

Here is the code of my appender :

 

<?xml version="1.0"; encoding="utf-8&quot; ?>

<log4net>

 

  <appender name="Inari&quot; type="log4net.Appender.RollingFileAppender";>

 &nbsp;  &lt;file value="./Logs/inari.log&quot; />

 &nbsp;  &lt;appendToFile value="true&quot; />

 &nbsp;  &lt;RollingStyle value="Composite" />

 &nbsp;  &lt;DatePattern value="yyyyMMdd" />

 &nbsp;  &lt;maximumFileSize value="8MB"; />

 &nbsp;  &lt;maxSizeRollBackups value="10" />

 &nbsp;  &lt;layout type="log4net.Layout.PatternLayout&quot;>

 &nbsp; &nbsp;  <conversionPattern value="%level %date %-4timestamp {%thread} [%logger] - %message%newline&quot; />

 &nbsp;  &lt;/layout>

  </appender>

 

  <appender name="InariMetier" type="log4net.Appender.AdoNetAppender">

 &nbsp;  &lt;connectionType value="Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess, Version=9.2.0.401, Culture=neutral, PublicKeyToken=89b483f429c47342&quot; />

 &nbsp;  &lt;connectionString value="data source=INARI_D;User ID=INARI;Password=INARIDEV&quot; />

 &nbsp;  &lt;commandText value="INSERT INTO LOGMETIER (LOG_DATE,LOG_THREAD,LOG_LEVEL,LOG_LOGGER,LOG_MESSAGE) VALUES (:log_date, :thread, :log_level, :logger, :message)" />

 &nbsp;  &lt;bufferSize value="128"; />

 &nbsp;  &lt;parameter>

 &nbsp; &nbsp;  <parameterName value=":log_date" />

 &nbsp; &nbsp;  <dbType value="DateTime" />

 &nbsp; &nbsp;  <layout type="log4net.Layout.RawTimeStampLayout" />

 &nbsp;  </parameter>

 &nbsp;  &lt;parameter>

 &nbsp; &nbsp;  <parameterName value=":thread&quot; />

 &nbsp; &nbsp;  <dbType value="String&quot; />

 &nbsp; &nbsp;  <size value="255"; />

 &nbsp; &nbsp;  <layout type="log4net.Layout.PatternLayout&quot;>

 &nbsp; &nbsp; &nbsp;  <conversionPattern value="%thread&quot; />

 &nbsp; &nbsp;  </layout>

 &nbsp;  &lt;/parameter>

 &nbsp;  &lt;parameter>

 &nbsp; &nbsp;  <parameterName value=":log_level" />

 &nbsp; &nbsp;  <dbType value="String&quot; />

 &nbsp; &nbsp;  <size value="50" />

 &nbsp; &nbsp;  <layout type="log4net.Layout.PatternLayout&quot;>

 &nbsp; &nbsp; &nbsp;  <conversionPattern value="%level&quot; />

 &nbsp; &nbsp;  </layout>

 &nbsp;  &lt;/parameter>

 &nbsp;  &lt;parameter>

 &nbsp; &nbsp;  <parameterName value=":logger&quot; />

 &nbsp; &nbsp;  <dbType value="String&quot; />

 &nbsp; &nbsp;  <size value="255"; />

 &nbsp; &nbsp;  <layout type="log4net.Layout.PatternLayout&quot;>

 &nbsp; &nbsp; &nbsp;  <conversionPattern value="%logger&quot; />

 &nbsp; &nbsp;  </layout>

 &nbsp;  &lt;/parameter>

 &nbsp;  &lt;parameter>

 &nbsp; &nbsp;  <parameterName value=":message" />

 &nbsp; &nbsp;  <dbType value="String&quot; />

 &nbsp; &nbsp;  <size value="4000&quot; />

 &nbsp; &nbsp;  <layout type="log4net.Layout.PatternLayout&quot;>

 &nbsp; &nbsp; &nbsp;  <conversionPattern value="%message" />

 &nbsp; &nbsp;  </layout>

 &nbsp;  &lt;/parameter>

  </appender>

 

  <logger name="Cnr";>

 &nbsp;  &lt;level value="ALL"; />

 &nbsp;  &lt;appender-ref ref="Inari&quot; />

 &nbsp;  &lt;appender-ref ref="InariMetier" />

  </logger>

 

</log4net>

CREATE TABLE LOGMETIER

(

  LOG_DATE ; &nbsp;  TIMESTAMP(3),

  LOG_THREAD&nbsp;  VARCHAR2(255 BYTE),

  LOG_LEVEL&nbsp; &nbsp; VARCHAR2(255 BYTE),

  LOG_LOGGER&nbsp;  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

 

 

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )