简体   繁体   中英

Log4j JPA Appender

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM