View Javadoc

1   /**
2    * LOGBack: the reliable, fast and flexible logging library for Java.
3    * 
4    * Copyright (C) 1999-2006, QOS.ch
5    * 
6    * This library is free software, you can redistribute it and/or modify it under
7    * the terms of the GNU Lesser General Public License as published by the Free
8    * Software Foundation.
9    */
10  
11  package ch.qos.logback.core.rolling;
12  
13  import java.io.File;
14  
15  import ch.qos.logback.core.spi.LifeCycle;
16  
17  
18  /**
19   * A <code>TriggeringPolicy</code> controls the conditions under which roll-over
20   * occurs. Such conditions include time of day, file size, an 
21   * external event, the log request or a combination thereof.
22   *
23   * @author Ceki G&uuml;lc&uuml;
24   * */
25  
26  public interface TriggeringPolicy<E> extends LifeCycle {
27    
28    /**
29     * Should roll-over be triggered at this time?
30     * 
31     * @param activeFile A reference to the currently active log file. 
32     * @param event A reference to the currently event. 
33     * @return true if a roll-over should occur.
34     */
35    public boolean isTriggeringEvent(final File activeFile, final E event);
36  }