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.

&gt; as far as i can see 
&gt; LogEvents don't have fields for those items, and
the &gt; JDBCAppender logs 
&gt; LogEvent objects.  So you'll have to do some
coding.
&gt; A couple options off the top of my hand:
&gt; 1) extend PatternLayout with conversion
characters 
&gt; for all those things
&gt; 2) override getLogStatement(...) in JDBCAppender.
 
&gt; 3) create your log message specifically for
logging &gt; to the db, with 
&gt; commas and such embedded.  Then tell the 
&gt; JDBCAppender to insert just the 
&gt; message.
&gt;    example:  log.info
&gt; (&#34; 'empABC', 'sessionABC', 'John',
'transABC', 
&gt; '2002-07-23', 5, 'Result' &#34;);
&gt;     config:  log4j.myjdbcappender.sql = insert
into &gt; logMessage (Emp_id, 
&gt; 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>