logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From panti...@firstenergycorp.com
Subject RE: Still looking for help with ADONETAppender example.
Date Thu, 24 Jun 2004 13:05:33 GMT

Cort,

No, I didn't know about that. I'll have to take a look.

Thanks for the tip.



|---------+---------------------------->
|         |           "Cort Schaefer"  |
|         |           <cort@xmission.co|
|         |           m>               |
|         |                            |
|         |           06/23/2004 04:47 |
|         |           PM               |
|         |           Please respond to|
|         |           "Log4NET User"   |
|         |                            |
|---------+---------------------------->
  >-------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                      
                                        |
  |       To:       "'Log4NET User'" <log4net-user@logging.apache.org>             
                                              |
  |       cc:                                                                            
                                        |
  |       Subject:  RE: Still looking for help with ADONETAppender example.              
                                        |
  >-------------------------------------------------------------------------------------------------------------------------------|




Have you tried using DbgView.exe from sysinternals.com to see what log4net
is outputting through the DebugPrint API?  This is always been the way that
I have resolved issues like this in the past.  I don't use Oracle on any of
my .Net projects, so I can't comment about that specifically.

Cort

-----Original Message-----
From: pantichd@firstenergycorp.com [mailto:pantichd@firstenergycorp.com]
Sent: Wednesday, June 23, 2004 1:57 PM
To: log4net-user@logging.apache.org
Subject: Still looking for help with ADONETAppender example.

Hello,

I am still not able to get the ADONETAppender example to work with Oracle.
Everything runs fine as far as I can tell (i.e. no errors). If I run it in
debug mode and the following if stmt is true and the parms inside it get
executed but nothing is written to Oracle.

      Private Shared ReadOnly oraclelog As ILog =
LogManager.GetLogger("ADONetAppender_Oracle")
           ...
          If oraclelog.IsDebugEnabled Then oraclelog.Debug("oracle
message")

Please refer to the original post below for the detail information.

Can anyone help me PLEASE?

David


--------------    2nd message ---------------

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!

David

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

Hello,

I getting stuck trying to get this Oracle logging example to work ... (
http://log4net.sourceforge.net/release/1.2.0.30507/doc/manual/example-config

-appender.html
)  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:

CREATE TABLE CSAX30.LOG
(
      THREAD      VARCHAR2(255),
      LOG_LEVEL   VARCHAR2(255),
      LOGGER      VARCHAR2(255),
      MESSAGE     VARCHAR2(4000)
)
TABLESPACE CSAX30D LOGGING

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>
            </param>
            <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>
            </param>
            <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>
            </param>
            <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" />
                  </param>
            </param>
      </appender>

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


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.

David.





-----------------------------------------
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.











-----------------------------------------
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.


Mime
View raw message