it.andynaz.log
Class FileLogger

java.lang.Object
  extended by it.andynaz.log.Logger
      extended by it.andynaz.log.FileLogger

public class FileLogger
extends Logger

File Logger. Writes the logs on a text file.

Each constructor calls the corresponding constructor of the Logger class, so that FileLogger objects inherits alla the properties the Logger class has.

Version:
2013/01/14
Author:
andynaz

Field Summary
protected  File logFile
          File in which write the logs.
 
Fields inherited from class it.andynaz.log.Logger
dateFormat, level, name, separator, withDate, withLevel
 
Constructor Summary
FileLogger(Config conf)
          Creates a FileLogger with a configuration.
FileLogger(File logFile)
          Creates a FileLogger.
FileLogger(String name)
          Creates a FileLogger with a name.
FileLogger(String name, Config conf)
          Creates a FileLogger with a name and a configuration.
 
Method Summary
 void log(String log, Level level)
          Writes the log.
 
Methods inherited from class it.andynaz.log.Logger
getDate, getPrefix, log, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logFile

protected File logFile
File in which write the logs.

Constructor Detail

FileLogger

public FileLogger(String name,
                  Config conf)
Creates a FileLogger with a name and a configuration.

The path of the file in which write the logs is taken from the property "fileLogger.file".

Parameters:
name - name of the Logger
conf - configuration of the Logger

FileLogger

public FileLogger(String name)
Creates a FileLogger with a name. The configuration used is the shared one.

Parameters:
name - name of the Logger

FileLogger

public FileLogger(Config conf)
Creates a FileLogger with a configuration.

Parameters:
conf - configuration of the Logger

FileLogger

public FileLogger(File logFile)
Creates a FileLogger. The configuration used is the shared one.

Method Detail

log

public void log(String log,
                Level level)
Writes the log. If it is not possible, invokes the Logger.log(java.lang.String, it.andynaz.log.Level) method.

Overrides:
log in class Logger
Parameters:
log - log to be written
level - log level


(c) 2013 andynaz - http://andynaz.altervista.org