logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From panti...@firstenergycorp.com
Subject Logging to Oracle -- still looking for help
Date Tue, 15 Jun 2004 10:48:24 GMT
Hello again,

I'm still looking for any assistance I can get with this problem. Wasn't
sure if the lack of response was due to the fact that nobody else has done
this or something that I did in my post (too much information in post?  Not
formatted right?)

If there is ANYTHING else I can provide please let me know. I'd really like
to figure out how to get this to work. There doesn't seem to be any other
resources besides this mailing list when it comes to log4net. If there are
I'd really appreciate it if anyone could point me to them.

Thanks in advance!


--------------    original message ---------------


I getting stuck trying to get this Oracle logging example to work ... (
)  We don't have Oracle 9. The only thing I thought I had to do was to
eliminate the Datetime column because our version of Oracle doesn't have a
datatype of timestamp.

So my table is defined as follows:

      THREAD      VARCHAR2(255),
      LOG_LEVEL   VARCHAR2(255),
      LOGGER      VARCHAR2(255),
      MESSAGE     VARCHAR2(4000)

The Web.config file section for this appender looks like this:

      <appender name="ADONetAppender_Oracle" type
="log4net.Appender.ADONetAppender" >
            <param name="ConnectionType" value
="System.Data.OracleClient.OracleConnection, System.Data.OracleClient,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            <param name="ConnectionString" value="data source=oragen1d;User
ID=csax30;Password=oragen1d" />
            <param name="CommandText" value="INSERT INTO Log
(Thread,Log_Level,Logger,Message) VALUES (:log_date, :thread, :log_level,
:logger, :message)" />
            <param name="BufferSize" value="128" />
            <param name="Parameter">
                  <param name="ParameterName" value=":thread" />
                  <param name="DbType" value="String" />
                  <param name="Size" value="255" />
                  <param name="Layout" type="log4net.Layout.PatternLayout">
                        <param name="ConversionPattern" value="%t" />
            <param name="Parameter">
                  <param name="ParameterName" value=":log_level" />
                  <param name="DbType" value="String" />
                  <param name="Size" value="50" />
                  <param name="Layout" type="log4net.Layout.PatternLayout">
                        <param name="ConversionPattern" value="%p" />
            <param name="Parameter">
                  <param name="ParameterName" value=":logger" />
                  <param name="DbType" value="String" />
                  <param name="Size" value="255" />
                  <param name="Layout" type="log4net.Layout.PatternLayout">
                        <param name="ConversionPattern" value="%c" />
            <param name="Parameter">
                  <param name="ParameterName" value=":message" />
                  <param name="DbType" value="String" />
                  <param name="Size" value="4000" />
                  <param name="Layout" type="log4net.Layout.PatternLayout">
                        <param name="ConversionPattern" value="%m" />

And in my code I do this...
          Private Shared ReadOnly oraclelog As ILog =
          If oraclelog.IsDebugEnabled Then oraclelog.Debug("oracle

I've stepped thru the code in debugger and the "oraclelog.IsDebugEnabled"
method returns True. I've enclosed the above statement in a try/catch
thinking that maybe there was an error but there was none.

I'm sure I'm missing something very simple but I can't figure out what.

Has anyone been successful in logging to Oracle? If so, can you tell what
I'm doing wrong?

Thanks in advance for any help.


The information contained in this message is intended only for the personal and confidential
use of the recipient(s) named above. If the reader of this message is not the intended recipient
or an agent responsible for delivering it to the intended recipient, you are hereby notified
that you have received this document in error and that any review, dissemination, distribution,
or copying of this message is strictly prohibited. If you have received this communication
in error, please notify us immediately, and delete the original message.

View raw message