Class FileLogger

Description

The FileLogger class is a concrete implementation of the abstract Logger class that stores log messages in files.

Each message ends up in a file named after the level of the message.

3 levels of messages are maintained by default:

  • info: normal behavior information
  • warning: problems that may be worth noting but are ignored by the method
that logs the message
  • error: problems that lead to an error in the application.
The class requires the existence of a "log" subfolder, and needs to have write-access to that subfolder.

Located in /common/logger/implementation/filelogger/filelogger.php (line 40)

Logger
   |
   --FileLogger
Method Summary
FileLogger __construct ()
void add_message ($message_content $message_content, [$level $level = 'warning'])
void clear_messages ([$level_value $level_value = 'all'])
a retrieve_messages ([$level_value $level_value = 'all'])
Variables

Inherited Variables

Inherited from Logger

Logger::$levels
Methods
Constructor __construct (line 50)

Builds the logger by setting the source folder and the supported levels.

  • access: public
FileLogger __construct ()
add_message (line 67)

Adds a message to the set of message

void add_message ($message_content $message_content, [$level $level = 'warning'])
  • $message_content $message_content: the content of a message in a string.
  • $level $level: the level of the message (by default : warning).

Redefinition of:
Logger::add_message()
Logs a message at the given level.
clear_messages (line 128)

Clears all messages to the set of messages which are in the given level.

void clear_messages ([$level_value $level_value = 'all'])
  • $level_value $level_value: the level to search messages. If 'all', retrieve all the messages. By default, the value is 'all'.

Redefinition of:
Logger::clear_messages()
Purges the logs of all the messages that are at the requested leve.
retrieve_messages (line 88)

Retirves all messages to the set of messages which are in the given level.

  • return: set of Message object.
a retrieve_messages ([$level_value $level_value = 'all'])
  • $level_value $level_value: the level to search messages. If 'all', retrieve all the messages. By default, the value is 'all'.

Redefinition of:
Logger::retrieve_messages()
Retrieves all messages logged at the requested level.

Inherited Methods

Inherited From Logger

Logger::add_message()
Logger::clear_messages()
Logger::retrieve_messages()

Documentation generated on Tue, 17 Nov 2009 19:00:38 +0100 by phpDocumentor 1.4.2