At my workplace, we wrote a custom log4j appender that writes log messages to the database (uses a dedicated thread asynchronously, so no performance hit).
I prefer it a lot over writing to log files - a database-based log is much more easy to query and analyze.
Is there an open source solution that does this (for log4j specifically, or any other java loggers)?
Some things that our appender has, and I would like to see in an alternative:
- Logs exceptions (duh!)
- Database writes are from a separate thread/pool
Our appender supports the following columns, and I would like to see all of them in whatever solution we find.
- LogId
- Time
- message
- stacktrace
- process id
- thread id
- machine name
- component
- Level (debug/info/warn/...)
- ThreadName
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…