Thanks CM, got the JMSAppender working. However there are a few queries still in my mind
1. How can I insert values in the database which is equivalent to this SQL
INSERT INTO LOG_TEST (EXECUTION_DATE, LOGGER, PRIORITY, MESSAGE)
VALUES ('%d', '%c', '%p', '%m')
The above query maps to the following configuration that I have done in my
log4j.xml file for JDBCAppender
<appender name="JDBC" class="org.apache.log4j.jdbc.JDBCAppender">
<param name="driver" value="oracle.jdbc.driver.OracleDriver" />
<param name="URL" value="jdbc:oracle:thin:@10.45.194.47:1521:wells" />
<param name="user" value="view2" />
<param name="password" value="view2" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{MM:dd:yyyy HH:mm:ss} - %m" />
</layout>
<param name="sql" value="INSERT INTO LOG_TEST (EXECUTION_DATE, LOGGER,
PRIORITY, MESSAGE) VALUES ('%d', '%c', '%p', '%m')" />
</appender>
Now if I want to do something similar using JMSAppender how do I do it.
Since I have written an MDB, I will receive just a Message object in my
onMessage method. So at most I can log only the message (%m). But what if I
want to log different values in the database just the way I am doing in case
of JDBCAppender above
How will I go about implementing that.
I am attaching my MDB with this mail for JMSAppender for your reference.
Essentially what I want to do is insert
1. The execution date
2. Logger type
3. Priority
4. The log message
something like INSERT INTO LOG_TEST (EXECUTION_DATE, LOGGER, PRIORITY,
MESSAGE) VALUES ('%d', '%c', '%p', '%m')
Thanks and Regards,
Jimmy
-----Original Message-----
From: Chandra Mohan A R [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 8:32 PM
To: Log4J Developers List
Subject: RE: JMSAppender
Hi Jimmy,
Follow the following steps:
1. Create a Connection Factory for JMS in WLS.
2. Create a JMS Server(if u dont want to use an existing one) in WLS.
3. Create a destination of type JMS Topic for the server u previously
created.
4. In the log4j.properties/ log4j.xml use the JMSAppender class.
5. Specify the jndi of the factory and topic as given in step1 and step3.
Happy logging .....
regards,
CM
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, February 13, 2004 1:07 AM
To: [EMAIL PROTECTED]
Subject: JMSAppender
Hi All,
Can anyone please tell me as to how do I go about using the JMSAppender to
log messages to a JMS topic. I am using Weblogic 8.1
Thanks & Regards,
Jimmy Shah
MphasiS-BFL Limited,
Wells Fargo Banking Services,
160 Spear Street, San Fransisco,
CA-94108, USA.
Tel :- O - (415) 498-1894
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
LogBean.java
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
