[logback-user] Logback logging to MySQL

Simon Gaeremynck gaeremyncks at gmail.com
Fri Jun 3 20:07:26 CEST 2011

I've noticed this behaviour as well and asked about it on this list [1].
But it went passed unnoticed.

It seems that the mysql.sql file has the same missing column names.
When I added those column names, everything ran perfectly.



[1] http://markmail.org/message/eqlyxeqjtd7jogsj 

On 3 Jun 2011, at 20:00, Stephen Schaeffer wrote:

> Hi all,
> I am in the process of exploring logback so we can migrate our logging off of our current mishmash. As part of that I have been trying to configure to write to a MySQL database.
> In the configuration file I have this:
>>   <appender name="DB" class="ch.qos.logback.access.db.DBAppender">
>>     <connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">
>>       <driverClass>com.mysql.jdbc.Driver</driverClass>
>>       <url>jdbc:mysql://localhost:3306/test</url>
>>       <user>logback</user>
>>       <password>logback</password>
>>     </connectionSource>
>>     <insertHeaders>true</insertHeaders>
>>   </appender>
>>   <root level="DEBUG">
>>     <appender-ref ref="STDOUT" />
>>     <appender-ref ref="FILE" />
>>     <appender-ref ref="DB" />
>>   </root>
> And I've run the scripts to set up the tables in MySQL, and logback can apparently connect ok - if I change any of the parameters in the config I get errors about it not connecting.
> On the console and in the logfile I can see output as I would expect, but the DB remains empty. I'm using MySQL 5.1.51 on a Mac, for what that's worth.
> Stephen Schaeffer
> This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20110603/cabb6b53/attachment.html>

More information about the Logback-user mailing list