1
votes

I am trying to save some Log Events with log4j's JPA Appender , I've followed the tutorial here (JPAAppender).

But when I am testing the logger , I get some log4j errors/warnings about the log4j.properties :

log4j:WARN Continuable parsing error 2 and column 31

log4j:WARN Document root element "Configuration", must match DOCTYPE root "null".

log4j:WARN Continuable parsing error 2 and column 31

log4j:WARN Document is invalid: no grammar found.

log4j:WARN Please initialize the log4j system properly.

Supposing that the problem is at log4j.properties file , any help?? Thanks.

1
Where did you place your log4j properties? - Hirak
i define it at vm options - AntJavaDev
-Dlog4j.configuration=../log4j.xml - AntJavaDev
can you try one thing? Remove the vm option, put the log4j.prop... in the "bin" folder, where all your classes reside. And check if it is working. This is a TEMP step, just to make sure your appender is working. - Hirak
no luck , but in this case it totally ignores the .properties and get the default configuration for hibernate and spring loggers - AntJavaDev

1 Answers

0
votes

Solved with JDBC appender , i used the command :

log4j.appender.JDBC.sql=INSERT INTO ....

I just pass the requested parameters to the insert query ,nevertheless i have persistence configured. Thanks to log4j.MDC

MDC tutorial