Server logs to Postgresql #5186
-
Hi, I found the information in log4j about how to write server logs into the database but pictured some issues. Is there anyone has done this before? sending server logs to Postgres? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
A few things to be aware of:
I would also be curious about what happens in Log4J if the DB connection is lost or the DB runs out of space. What happens to the logs and the application? What problem are you trying to solve? Do you have large log files (logging less data might be better, log4j and logrotate also have compression options)? Do you need to preserve log files for a long time (is a DB a good choice or a tool like Graylog or some other log archiver)? |
Beta Was this translation helpful? Give feedback.
-
here is the solution from my end:
here is my final log4j.properties that saves server logs to Postgres db:
|
Beta Was this translation helpful? Give feedback.
here is the solution from my end:
CREATE TABLE LOGS (USER_ID VARCHAR(20) NOT NULL, DATED DATE NOT NULL, LOGGER VARCHAR(100) NOT NULL, LEVEL VARCHAR(10) NOT NULL, MESSAGE VARCHAR(1000) NOT NULL );
database
folder in MC, and past/place it inserver-launcher-lib
folder in MC(mirth connect).here is my final log4j.properties that saves server logs to Postgres db: