From: Kevin G. <ke...@go...> - 2002-12-10 17:07:26
|
After working with that a little bit, I see it's still missing something, and I see why log4j was appending items to a buffer, because you really want parts of your log message to end up in different columns in the database. This is the kind of API that's wanted, to be able to call $logger->warn( ['schoolteacher',1732,'employee is underpaid!'] ); being set up like this: =================================================== log4j.appender.DBAppndr.sqlStatement = \ insert into log4perltest \ (date,loglevel, employee_type, emp_id, msg) \ values (?,?,?,?,?) log4j.appender.DBAppndr.params.1 = %d log4j.appender.DBAppndr.params.2 = %p # 3 is employee_type # 4 is emp_id log4j.appender.DBAppndr.params.5 = %m #noop layout to pass the arrayref through log4j.appender.DBAppndr.layout = Log::Log4perl::Layout::NoopLayout ================================================== so can can mix bind vales from custom cspecs with array items from your logger call. Being able to pass an arrayref means PatternLayout and SimpleLayout must check for an arrayref and join it if they find one. The NoopLayout is required to have a layout that will leave the arrayref alone. Any thoughts on that? -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |