How do I create a logrotate friendly file writer in Java or other platform?
What are the best practices for implementing a file writer/logger in Java that is compatible with logrotate ? The goal would be allow logrotate to be used for all log management, instead of using built-in rotation/management of a logging API (Log4J, etc). I'd be interested in hearing comments/answers for other development platforms, aside from Java. You simply need to periodically close and re-open the log file inside your application. You need a handler that keeps last close time. The handler should close and reopens the file if (for example) 20 seconds passed since last close and log entry