This all sounds reasonable to me. However, note that we have o.a.l.log4j.net 
which has all the networking related managers. Perhaps it should have been 
under appenders as well, but it also supports servers as well as managers, 
which probably isn't as likely with db appenders...?

Ralph

On Apr 27, 2013, at 8:20 AM, Nick Williams wrote:

> 
> On Apr 27, 2013, at 9:50 AM, Gary Gregory wrote:
> 
>> On Sat, Apr 27, 2013 at 10:43 AM, Nick Williams 
>> <[email protected]> wrote:
>> There already existed an o.a.l.log4j.core.appender.db package that was 
>> empty. I discovered that I could create a base AbstractDatabaseAppender that 
>> took care of some operations common to JDBC, JPA /and/ NoSQL appenders. That 
>> led me to use the existing db package as follows:
>> 
>> db/
>>     common DB appender classes
>> 
>> What is in common?
>> 
>> Gary
> 
> - An AbstractDatabaseManager that defines connect and disconnect methods for 
> concrete managers to implement, defines an isConnected method, defines a 
> buffer size property, and controls buffering (which all types will support).
> 
> - An AbstractDatabaseAppender that has a type parameter of LogEvent, requires 
> an AbstractDatabaseManager implementation in its constructor, calls the 
> manager's connect and disconnect methods when the appended is started and 
> stopped (respectively), allows for manager replacement (configuration 
> reloading) without event loss, and forwards events to the manager for writing 
> to the database.
> 
> This way, each database type will only need to implement 
> connect/disconnect/write methods in the manager, implement an appender with a 
> simple factory method to create the correct manager, and create whatever 
> classes are necessary (if necessary) to support configuration.
> 
>>  
>>     jdbc/
>>         JDBC appender classes
>>     jpa/
>>         JPA appender classes
>>     nosql/
>>         NoSQL appender classes
>> 
>> I think that package structure makes a lot of sense. I'm open to convincing 
>> arguments otherwise.
>> 
>> Nick
>> 
>> On Apr 27, 2013, at 9:37 AM, Gary Gregory wrote:
>> 
>> > I think we should keep the packaging simpler: o.a.l.log4j.core.appender.jpa
>> >
>> > Gary
>> >
>> > On Apr 27, 2013, at 10:15, Nick Williams <[email protected]> 
>> > wrote:
>> >
>> >> o.a.l.log4j.core.appender.db.jpa
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [email protected]
>> > For additional commands, e-mail: [email protected]
>> >
>> 
>> 
>> 
>> 
>> -- 
>> E-Mail: [email protected] | [email protected] 
>> Java Persistence with Hibernate, Second Edition
>> JUnit in Action, Second Edition
>> Spring Batch in Action
>> Blog: http://garygregory.wordpress.com 
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
> 

Reply via email to