com.atomikos.diagnostics
Class RotatingFileConsole

java.lang.Object
  extended by com.atomikos.diagnostics.RotatingFileConsole
All Implemented Interfaces:
Console

public class RotatingFileConsole
extends Object
implements Console

A console that writes to a set of rotating files.


Field Summary
 
Fields inherited from interface com.atomikos.diagnostics.Console
DEBUG, INFO, WARN
 
Constructor Summary
RotatingFileConsole(String fileNamePattern, int limit, int fileCount)
           
 
Method Summary
 void close()
          Closes the console after use.
 int getLevel()
          Gets the level of the console.
 void print(String string)
          Print a string to the output, but no newline at the end.
 void print(String string, int level)
          Print a string with a given level of granularity.
 void println(String string)
          Print a message to the output of the console.
 void println(String string, int level)
          Print a string with newline, at a given level of granularity.
 void setLevel(int level)
          Set the overall granularity level of the console.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RotatingFileConsole

public RotatingFileConsole(String fileNamePattern,
                           int limit,
                           int fileCount)
                    throws SecurityException,
                           IOException
Throws:
SecurityException
IOException
Method Detail

println

public void println(String string)
             throws IOException
Description copied from interface: Console
Print a message to the output of the console. The level is assumed to be the default (WARN).

Specified by:
println in interface Console
Parameters:
string - The message to output.
Throws:
IOException - On failure.

print

public void print(String string)
           throws IOException
Description copied from interface: Console
Print a string to the output, but no newline at the end. The level is assumed to be the default (WARN).

Specified by:
print in interface Console
Parameters:
string - The string to print.
Throws:
IOException - On failure.

println

public void println(String string,
                    int level)
             throws IOException
Description copied from interface: Console
Print a string with newline, at a given level of granularity.

Specified by:
println in interface Console
Parameters:
string - The string.
level - The level (one of the predefined constants).
Throws:
IOException - On failure.

print

public void print(String string,
                  int level)
           throws IOException
Description copied from interface: Console
Print a string with a given level of granularity.

Specified by:
print in interface Console
Parameters:
string - The string
level - The level (one of the predefined constants).
Throws:
IOException - On failure.

close

public void close()
           throws IOException
Description copied from interface: Console
Closes the console after use.

Specified by:
close in interface Console
Throws:
IOException - On failure.

setLevel

public void setLevel(int level)
Description copied from interface: Console
Set the overall granularity level of the console. Messages printed with a higher level will be ignored.

Specified by:
setLevel in interface Console
Parameters:
level - The level, one of the predefined constants. Default is WARN.

getLevel

public int getLevel()
Description copied from interface: Console
Gets the level of the console.

Specified by:
getLevel in interface Console
Returns:
The log level.


Copyright © 2011. All Rights Reserved.