You can modify the insert statement to change the date string to the corresponding datetime, for example:
log4j.appender.DB.sql=INSERT INTO logs VALUES('%x',STR_TO_DATE( '%d', '%Y-%M-%d %H:%i' ),'%C','%p','%m')
This is not an appropriate format, but simply the idea of a different approach.
I'm just looking at mysql millisecond processing, but I see that the date string: '2012-11-17 16: 07: 29,995' is 995 parts of a millisecond or is 29 995 parts of a decimal second?
source share