BackupEnabledDailyRollingFileAppender.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:utils4j 作者:
/**
 * This method differentiates DailyRollingFileAppender from its super class.
 * 
 * <p>
 * Before actually logging, this method will check whether it is time to do
 * a rollover. If it is, it will schedule the next rollover time and then
 * rollover.
 * 
 * @param event
 *            the event
 */
protected void subAppend(LoggingEvent event)
{
    long n = System.currentTimeMillis();
    if (n >= nextCheck)
    {
        now.setTime(n);
        nextCheck = rc.getNextCheckMillis(now);
        try
        {
            rollOver();
        }
        catch (IOException ioe)
        {
            if (ioe instanceof InterruptedIOException)
            {
                Thread.currentThread().interrupt();
            }
            LogLog.error("rollOver() failed.", ioe);
        }
    }
    super.subAppend(event);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号