Posted By:
Mahesh_Puvvada
Posted On:
Friday, November 15, 2002 03:55 PM
I am using Log4j to log the messages to a database in my application. The database has the columns, say, Message, Login Time, Logout Time etc. Is it possible to construct the sql in config file such that the logger takes all the user inputs to insert into different columns of the database. for ex, usually, the config file will have a line log4j.appender.MyAppender.sql=INSERT INTO TEST (MESSAGE) VALUES ('%m') but, i want to have something like this log4j.appender.MyAppender.sql=INSERT INTO TESTLOG (MESSAGE, LOGINTIME, LOGOUTTIME) VALUES ('%m', Login time, Logout time) where Login time and logout time are to be passed through program. (I dont want t
More>>
I am using Log4j to log the messages to a database in my application. The database has the columns, say, Message, Login Time, Logout Time etc.
Is it possible to construct the sql in config file such that the logger takes all the user inputs to insert into different columns of the database.
for ex, usually, the config file will have a line
log4j.appender.MyAppender.sql=INSERT INTO TEST (MESSAGE) VALUES ('%m')
but, i want to have something like this
log4j.appender.MyAppender.sql=INSERT INTO TESTLOG (MESSAGE, LOGINTIME, LOGOUTTIME) VALUES ('%m', Login time, Logout time)
where Login time and logout time are to be passed through program. (I dont want to use setSql() through the program)
Is this possible?
<<Less