Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我编写了一个日志解析器,它不断读取日志文件,从日志中获取特定行并将它们写入数据库。日志是通过 LOG4J 生成的。当日志达到特定大小时,它们会被轮换。我的问题是我的日志解析器进程不允许 log4j 轮换日志。
您能否就此提出建议。
问候。
一个更干净的解决方案是使用org.apache.log4j.jdbc.JDBCAppender您想要在数据库中的日志语句,并让 log4j 直接插入它们。
org.apache.log4j.jdbc.JDBCAppender