<font size=2 face="sans-serif">Hello again, I found out that the configuration
actually logged to the database, causing the performance decrease. The
filter wasn't working as expected, because I didn't set the "onMatch"
and "onMismatch" tags. Here's the working solution:</font>
<br>
<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">
<onMatch>ACCEPT</onMatch></font>
<br><font size=2 face="sans-serif">
<onMismatch>DENY</onMismatch></font>
<br><font size=2 face="sans-serif"> </filter></font>
<br>
<br><font size=2 face="sans-serif">Shouldn't this be default instead of
NEUTRAL for both onMatch and onMismatch?</font>
<br>
<br><font size=2 face="Arial">Best regards,</font>
<br>
<br><font size=2 face="sans-serif">Simon Erhardt<br>
</font>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">Simon.Erhardt@befine-solutions.com</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">logback-user@qos.ch</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">31.10.2014 07:41</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">[logback-user]
Why does DBAppender slow down logging although it
has a non-matching filter?</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by:
</font><font size=1 face="sans-serif">"Logback-user"
<logback-user-bounces@qos.ch></font>
<br>
<hr noshade>
<br>
<br>
<br><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><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
<?xml version="1.0" encoding="UTF-8"?></font><font size=3>
</font><font size=2 face="sans-serif"><br>
<configuration></font><font size=3> </font><font size=2 face="sans-serif"><br>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"></font><font size=3>
</font><font size=2 face="sans-serif"><br>
<encoder>...</encoder></font><font size=3>
</font><font size=2 face="sans-serif"><br>
</appender></font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
<appender name="DB" class="ch.qos.logback.classic.db.DBAppender"></font><font size=3>
</font><font size=2 face="sans-serif"><br>
<connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource"></font><font size=3>
</font><font size=2 face="sans-serif"><br>
<driverClass>oracle.jdbc.OracleDriver</driverClass></font><font size=3>
</font><font size=2 face="sans-serif"><br>
<url>...</url></font><font size=3>
</font><font size=2 face="sans-serif"><br>
</connectionSource></font><font size=3>
</font><font size=2 face="sans-serif"><br>
<filter class="ch.qos.logback.core.filter.EvaluatorFilter"></font><font size=3>
</font><font size=2 face="sans-serif"><br>
<evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator"></font><font size=3>
</font><font size=2 face="sans-serif"><br>
<marker>LOGDATABASE</marker></font><font size=3>
</font><font size=2 face="sans-serif"><br>
</evaluator></font><font size=3>
</font><font size=2 face="sans-serif"><br>
</filter></font><font size=3>
</font><font size=2 face="sans-serif"><br>
</appender></font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
<root level="info"></font><font size=3>
</font><font size=2 face="sans-serif"><br>
<appender-ref ref="STDOUT"
/></font><font size=3> </font><font size=2 face="sans-serif"><br>
<appender-ref ref="DB"
/></font><font size=3> </font><font size=2 face="sans-serif"><br>
</root></font><font size=3> </font><font size=2 face="sans-serif"><br>
</configuration></font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
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><font size=3> </font><font size=2 face="sans-serif"><br>
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><font size=3>
</font><font size=2 face="sans-serif"><br>
Or are there any other ideas why this is so slow?</font><font size=3> <br>
</font><font size=2 face="Arial"><br>
Best regards,</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Simon Erhardt</font><tt><font size=2>_______________________________________________<br>
Logback-user mailing list<br>
Logback-user@qos.ch<br>
</font></tt><a href="http://mailman.qos.ch/mailman/listinfo/logback-user"><tt><font size=2>http://mailman.qos.ch/mailman/listinfo/logback-user</font></tt></a>
<br>