[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4net-user
Subject:    RE: Logging to Oracle -- still looking for help
From:       "Nicko Cadell" <nicko () neoworks ! com>
Date:       2004-06-27 18:25:28
Message-ID: DDEB64C8619AC64DBC074208B046611C0B5D50 () kronos ! neoworks ! co ! uk
[Download RAW message or body]

David,

I don't have an Oracle 8 or 9 DB to test against, so I don't know
exactly what will work and what won't.

If you are not seeing any logging it is likely that an exception is
being thrown by the ADONetAppender. The exception will be hidden by
log4net. You will need to enable internal debug to see it:

http://logging.apache.org/log4net/release/manual/faq.html#internalDebug

I don't know how much help I can be with specific oracle errors as I
don't have an oracle server. All I can say is that log4net just used
standard ADO.NET to talk to the DB. The implementation is up to the
Oracle ADO.NET provider.

Nicko

> -----Original Message-----
> From: pantichd@firstenergycorp.com 
> [mailto:pantichd@firstenergycorp.com] 
> Sent: 15 June 2004 11:48
> To: log4net-user@logging.apache.org
> Subject: Logging to Oracle -- still looking for help
> 
> 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.
> 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic