You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "K. Mohan Nerella" <nj...@yahoo.com> on 2002/08/02 22:50:45 UTC
Re: JDBCAppender - Column values
good solution.
but i fail to see the need for extending the pattern
layout at all. if you can generate the SQL statement
and Log message as mentioned below what is the need
for a new extended pattern layout ? can you please
explain. i am, probably, missing something.
Mohan.
> as far as i can see
> LogEvents don't have fields for those items, and
the > JDBCAppender logs
> LogEvent objects. So you'll have to do some
coding.
> A couple options off the top of my hand:
> 1) extend PatternLayout with conversion
characters
> for all those things
> 2) override getLogStatement(...) in JDBCAppender.
> 3) create your log message specifically for
logging > to the db, with
> commas and such embedded. Then tell the
> JDBCAppender to insert just the
> message.
> example: log.info
> (" 'empABC', 'sessionABC', 'John',
'transABC',
> '2002-07-23', 5, 'Result' ");
> config: log4j.myjdbcappender.sql = insert
into > logMessage (Emp_id,
> Session_id, ...) values (%m)
=====
---
Reality is just a convenient measure of complexity.
- Alvy Ray Smith
----------------------------------------
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>