<font size=2 face="sans-serif">Hello there, we are using TomEE, SLF4J
and Logback. Our aim is to log certain logging statements into a database
(determined by a marker), in addition to the stdout. Here is our logback
configuration:</font>
<br>
<br><font size=2 face="sans-serif"> <?xml version="1.0"
encoding="UTF-8"?></font>
<br><font size=2 face="sans-serif"> <configuration></font>
<br><font size=2 face="sans-serif"> <appender
name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"></font>
<br><font size=2 face="sans-serif">
<encoder>...</encoder></font>
<br><font size=2 face="sans-serif"> </appender></font>
<br>
<br><font size=2 face="sans-serif"> <appender
name="DB" class="ch.qos.logback.classic.db.DBAppender"></font>
<br><font size=2 face="sans-serif">
<connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource"></font>
<br><font size=2 face="sans-serif">
<driverClass>oracle.jdbc.OracleDriver</driverClass></font>
<br><font size=2 face="sans-serif">
<url>...</url></font>
<br><font size=2 face="sans-serif">
</connectionSource></font>
<br><font size=2 face="sans-serif">
<filter class="ch.qos.logback.core.filter.EvaluatorFilter"></font>
<br><font size=2 face="sans-serif">
<evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator"></font>
<br><font size=2 face="sans-serif">
<marker>LOGDATABASE</marker></font>
<br><font size=2 face="sans-serif">
</evaluator></font>
<br><font size=2 face="sans-serif">
</filter></font>
<br><font size=2 face="sans-serif"> </appender></font>
<br>
<br><font size=2 face="sans-serif"> <root
level="info"></font>
<br><font size=2 face="sans-serif">
<appender-ref ref="STDOUT" /></font>
<br><font size=2 face="sans-serif">
<appender-ref ref="DB" /></font>
<br><font size=2 face="sans-serif"> </root></font>
<br><font size=2 face="sans-serif"> </configuration></font>
<br>
<br><font size=2 face="sans-serif">TomEE (which is configured to use SLF4J)
takes about 3 times longer to startup if the DBAppender is active (14 seconds
compared to 4 seconds). Although the filtering works and there are no log
entries in the database for the tomcat startup.</font>
<br><font size=2 face="sans-serif">I already know that I could use connection
pooling to speed up when it actually comes to database logging. But nevertheless
the filter should do it in this case. My suspicion is that there are connections
opened and closed during logging, even if the log statement is filtered
out. </font>
<br><font size=2 face="sans-serif">Or are there any other ideas why this
is so slow?</font>
<br>
<br><font size=2 face="Arial">Best regards,</font>
<br>
<br><font size=2 face="sans-serif">Simon Erhardt</font>