darkgoon83 / log4jdbc-remix

Automatically exported from code.google.com/p/log4jdbc-remix
0 stars 0 forks source link

SQL formatting problem #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
At this moment SQL is formated correctly only when Log4JdbcCustomFormatter is 
used and logger "jdbc.sqlonly" with logging level "INFO".

In other cases it isn't.

There is many bugs with SQL formatting because of 'sqlOccured' method you have 
added into Slf4jSpyLogDelegator. You have to find some time and test all 
loggers(jdbc.sqlonly, jdbc.sqltiming ...) with possible levels.

The main problem is that in your custom method 'sqlOccured' makes one SQL 
String from many(eg inserts in executeBatch) so that method "processSql" 
doesn't properly.

Your custom formatter(Log4JdbcCustomFormatter) supports only "jdbc.sqlonly" 
logger and doesn't support log levels.

Custom log formatter idea is OK, but I think that the most important thing is 
that your code shouldn't change default behavior of log4sql lib.

regards
Daniel Charczyński

Maybe 

Original issue reported on code.google.com by danielch...@gmail.com on 26 Nov 2011 at 2:09

GoogleCodeExporter commented 8 years ago
Hi Daniel,

Thanks for your feedback. I'm sure that you are right. I don't have a lot of 
time to look at this right now. If you would like to submit a patch (with 
tests!) that fixes this issue, I will happily use it if its reasonable, 
otherwise it could take some time for me to get round to looking it.

Regards
Tim

Original comment by tim.azzo...@gmail.com on 28 Nov 2011 at 1:23

GoogleCodeExporter commented 8 years ago

Original comment by tim.azzo...@gmail.com on 28 Jan 2012 at 10:28