From: Kevin G. <ke...@go...> - 2002-09-10 23:53:18
|
Here's another one I could use your opinions on. I've been working for two days on a DBI appender, and I'm not sure I'm completely happy with it. It requires subclassing to change much of the behavior (but then so does JDBCAppender as well as Log::Dispatch::DBI). If you subclass then you can apply PatternFormats to the column values, but I'm not sure that's an efficient way to do it. Following Log::Dispatch::DBI, it creates an $sth at the beginnng and just continues to use it, which is good for efficiency but might cause problems in long-running programs (mod_perl). It holds one connection open for each appender, which might be too many (or might not?) It doesn't follow log4j's JDBCAppender very closely, but then the java docs say that's going to change soon anyway. Do you guys have any thoughts on it? Do you think it's good enough to release, or does somebody think they can do better? Attached are two files and a patch. DBI.pm goes in lib/Log/Log4perl/Appenders/DBI.pm. -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |