Change log4j to Database
Quote from m-peeters on 13. March 2026, 15:37Hello, I have tried to change my jasper server to output logs into the database but it's just not doing anything. The logs table is empty and there's no error messages of any kind. Does anyone know how this is done for jasper server?
this is the guide I used: https://www.tutorialspoint.com/log4j/log4j_logging_database.htm
Hello, I have tried to change my jasper server to output logs into the database but it's just not doing anything. The logs table is empty and there's no error messages of any kind. Does anyone know how this is done for jasper server?
this is the guide I used: https://www.tutorialspoint.com/log4j/log4j_logging_database.htm
Quote from javaForge on 13. March 2026, 17:14You should pay attention to the way the table name is written, especially with uppercase and lowercase letters, because some databases are case-sensitive and this may create issues if the case does not match correctly. Also, in the documentation example it shows appender.0.col[3].pattern = %message. With this configuration it may print all MDC (Mapped Diagnostic Context) values of the thread, which can lead to formatting problems and sometimes may also cause errors when storing the data in the database. Finally, the line rootLogger.appenderRefs = JDBC is required in order to attach the JDBC appender to the root logger so that the logs can be properly written to the database.
You should pay attention to the way the table name is written, especially with uppercase and lowercase letters, because some databases are case-sensitive and this may create issues if the case does not match correctly. Also, in the documentation example it shows appender.0.col[3].pattern = %message. With this configuration it may print all MDC (Mapped Diagnostic Context) values of the thread, which can lead to formatting problems and sometimes may also cause errors when storing the data in the database. Finally, the line rootLogger.appenderRefs = JDBC is required in order to attach the JDBC appender to the root logger so that the logs can be properly written to the database.
