[ 
https://issues.apache.org/jira/browse/LOG4J2-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14071881#comment-14071881
 ] 

Matt Sicker commented on LOG4J2-734:
------------------------------------

I created a [test project|https://github.com/jvz/log4j-jdbc-spring-test] that 
demonstrates batch insertions using MySQL. Instructions on database setup are 
in the README. I test this with generating 100,000 log events on start-up (plus 
the ~500 log events that the trace level root logger will otherwise catch from 
Spring et al.). No connection pooling other than what might be done by the 
driver. I would have added connection pooling, but dbcp2 uses commons logging 
(as does Spring), and I needed to bind the DataSource before any loggers get 
initialized. The joys of testing a logging framework!

Anyways, this appears to work quite well. I configured this to use a batch size 
of 500 events. Although it's a new feature, it's such a trivially supported 
feature that it doesn't seem to be a bad idea to include it. Thanks to the 
existing code structure, this feature was nearly trivial to add.

> Add JDBC batch update support when supported
> --------------------------------------------
>
>                 Key: LOG4J2-734
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-734
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Appenders
>    Affects Versions: 2.0
>            Reporter: Matt Sicker
>            Assignee: Matt Sicker
>
> This would be especially useful for the flush() method in the database 
> manager class. The way the code is currently structured, this looks like it 
> would work out rather well, too.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to