View Javadoc

1   /*
2    * Copyright (c) 2006-2007 Creative Sphere Limited.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *
10   *   Creative Sphere - initial API and implementation
11   *
12   */
13  package org.abstracthorizon.danube.support.logging.util;
14  
15  import java.io.IOException;
16  import java.io.OutputStream;
17  
18  /**
19   * This interface defines simple log file (output stream) provider that
20   * knows how to rotate "logs"
21   *
22   * @author Daniel Sendula
23   */
24  public interface LogFileRotator {
25  
26      /**
27       * Returns output stream. This method checks if
28       * it is the time for logs to be rotated.
29       *
30       * @return output stream
31       * @throws IOException io exception
32       */
33      OutputStream logFile() throws IOException;
34  
35      /**
36       * This method forces log rotation.
37       *
38       * @throws IOException io exception
39       */
40      void rotate() throws IOException;
41  }