Hey folks.
Re-thinked IDEA!
So, I've been thinking over the weekend and couldn't let this one go. I've decided to re-try the idea of getting log4j to work.
I've been doing some coding and think I got it to work. Except, I do not really understand how to insert into the logger. I've created an JDBC-appender and the SQL looks like this:
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="INSERT INTO audit (timestamp, user, operation, source, resourceRange, additionalInfo) VALUES ('%d{yyyy-MM-dd H:mm:s,SSS}','%m', '%m', '%m', '%m', '%m')"
/>
</layout>
Is this correct? All values has the VARCHAR datatype.
But, the real question for me is how do I log this in the Java-code?
Can't really understand what values to insert to get the correct values to insert the database.
logger.log(?);
EDIT Problem RESOLVED. Apparently I've mixed up how the original JDBC-appender for Log4j works. It is not doable to get several inserts to the database through a log message. Instead, I used "jdbcplus" made by a German1. Thank you all for the help./Edit