You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by manish_goyal <ma...@infosys.com> on 2008/11/15 08:28:04 UTC
problem with JDBC logging
I have configured log4j.properties file for JDBC and File logging.
I am able to log data in file and database.
But in database, data is not in appropriate format. I am setting four
parameters, all these parameter is going to only one column.
i am setting like this in my java program:-
mylogger.info("data1");
mylogger.info("data2");
mylogger.info("data3");
i am getting like this :-
column1 column2 column3
data1 data1 data1
data2 data2 data2
data3 data3 data3
I want each parameter in different column like this :-
column1 column2 column3
data1 data2 data3
my log4j.properties file is :-
log4j.rootLogger=info,myAppender,JDBC
# File appender
log4j.appender.myAppender=org.apache.log4j.RollingFileAppender
log4j.appender.myAppender.file=D:/Data/testLog.log
log4j.appender.myAppender.maxFileSize=1024KB
log4j.appender.myAppender.maxBackupIndex=5
log4j.appender.myAppender.append=true
log4j.appender.myAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.myAppender.layout.ConversionPattern=%d %p [%c] - %m%n
# DBError DB Options
log4j.appender.JDBC=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.JDBC.URL=jdbc:oracle:thin:@10.87.187.163:1521:EPHOD1
log4j.appender.JDBC.user=test
log4j.appender.JDBC.password=test
log4j.appender.JDBC.driver=oracle.jdbc.driver.OracleDriver
#SQL statement to be used (with multiple columns formated)
log4j.appender.JDBC.sql=INSERT INTO
LOGGINGMESSAGE(CODE1,CODE2,REQUESTID,COMPONENTNAME)
values('%m','%m','%m','%m')
log4j.appender.JDBC.layout=org.apache.log4j.PatternLayout
log4j.appender.JDBC.layout.ConversionPattern=%d %p %c - %m%n
#log4j.appender.JDBC.layout.ConversionPattern=%m
log4j.appender.JDBC.bufferSize=4
Please give some suggestion.
I would appreciate your suggestion.
Thanks.
Regards,
Manish
--
View this message in context: http://www.nabble.com/problem-with-JDBC-logging-tp20513141p20513141.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.