I'm using Log4j 2 in my project to write son logs to a database table. These events are identified based on certain MDC key/value pair. My concern is about the unchecked LoggingException this appender can throw from its append method. These database logs are generated inside asynchronous, transactional process and I don't want the main process gets affected by a potential exception raised by the appender. How should I take care of it? Should I move the configuration based appender to a custom appender? Is there any guarantee that the appender won't rollback my business process in case of log event append error?
thks in advance
Assuming you are using JDBCAppender, I depends on two things:
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.