Hi all,
For log4j 1.3, I would like DBAppender, i.e. the successor to JDBCAppender, to be able to persist to a database in a format independent of the Java language.
For most fields this is not a problem except for the MDC (a map), properties (a map) and exceptions (an array of type string).
I am thinking of persisting each of these multi-valued fields into their own table. Thus, there will be a table for LoggingEvents containing most fields except for the throwable, MDC and properties.
The MDC field will be stored in its own table, consisting of a foreign key to the owning LoggingEvent instance, a column for the key and a column for the value. Each row in the MDC table will correspond to one (value,key) pair in an MDC instance. The throwable would also be stored in its own table, with each row corresponding to a line in the stack trace. The properties map will be stored in the same way as the MDC.
The advantage over java object serialization is that none of the fields would be opaque for the database and also programming language independent. Thus, one would be able to perform SQL queries on the MDC or the properties. (Give me all the events for userid=john).
Do log4cxx, log4net, or log4pgp support persistence of logging events into a db? Should we work on this in a coordinated fashion?
-- Ceki G�lc�
For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
