I understand that i can use a DailyRollingFileAppender to roll the log file every month, day, half-day, hour or minute. But how can i configure log4j to roll the log file ev
The Javadoc for DailyRollingFileAppender in Log4J indicates that the time-based rolling only occurs on unit-based rollovers (day, week, month, etc.). That would mean the closest you could get with that pattern is '.'yyyy-MM-dd-HH-mm, which would roll over every minute.
My recommendations would be to do one of the following:
FileAppender that uses logic borrowed from DailyRollingFileAppender to make the computationRollingPolicy that uses logic borrowed from the LOGBack time calculations (which will be very similar to the ones in Log4J)By the way, if you choose the latter, I'd recommend that you consider coding to the SLF4J API, and use LOGBack (or Log4J) as the underlying implementation.