3 Aug 2007 04:33
Re: Add or change parameter value dynamicly
Ron Grabowski <rongrabowski <at> yahoo.com>
2007-08-03 02:33:37 GMT
2007-08-03 02:33:37 GMT
Is your ProcessID a special variable that isn't available during startup or do you just want to include the
%processid pattern?
----- Original Message ----
From: arsenmkrt <mkrtchyan.arsen <at> gmail.com>
To: log4net-user <at> logging.apache.org
Sent: Tuesday, July 31, 2007 8:16:43 AM
Subject: Add or change parameter value dynamicly
Hello. I have a table T_Audit where i want to write my log messages in oracle
db. it has a field processid that i want to put dynamically its the
identifier of the process that is doing log not the real process just the id
of process table from my database so i decide to write my appender like this
<appender name="AdoNetAppender_Oracle"
type="log4net.Appender.AdoNetAppender">
<connectionType value="System.Data.OracleClient.OracleConnection,
System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" />
<connectionString value="my connection string" />
<commandText value="INSERT INTO T_AUDIT
(LOG_ID,RM_METADATA_ID,PROCESS_ID,PROCESS_TYPE,LOG_DATE,SEVERITY,LOG_MESSAGE)
VALUES
(SEQ_AUDIT.NEXTVAL,:rmmetadataid,:processid,:processtype,:log_date,:log_level,:message)"
/>
<bufferSize value="128" />
<parameter>
<parameterName value=":rmmetadataid" />
<dbType value="Int32" />
<layout type="log4net.Layout.PatternLayout">
(Continue reading)
RSS Feed