Class LoggerAppender

Description

Abstract class that defines output logs strategies.

  • version: $Revision: 1240469 $
  • abstract:

Located in /LoggerAppender.php (line 27)

LoggerConfigurable
   |
   --LoggerAppender
Direct descendents
Class Description
LoggerAppenderNull A NullAppender merely exists, it never outputs a message to any device.
LoggerAppenderMail Appends log events to mail using php function http://www.php.net/mail.
LoggerAppenderMailEvent Log every events as a separate email.
LoggerAppenderConsole ConsoleAppender appends log events to STDOUT or STDERR.
LoggerAppenderPhp Log events using php http://www.php.net/trigger_error function and a LoggerLayoutTTCC default layout.
LoggerAppenderPDO Appends log events to a db table using PDO.
LoggerAppenderMongoDB Appender for writing to MongoDB.
LoggerAppenderSyslog Log events to a system log using the http://www.php.net/syslog function.
LoggerAppenderFile FileAppender appends log events to a file.
LoggerAppenderSocket Appends events to a network socket.
LoggerAppenderEcho LoggerAppenderEcho uses echo function to output events.
Variable Summary
Method Summary
LoggerAppender __construct ([string $name = ''])
void activateOptions ()
void addFilter (LoggerFilter $filter)
void append (LoggerLoggingEvent $event)
void clearFilters ()
void close ()
void doAppend (LoggerLoggingEvent $event)
string getName ()
boolean requiresLayout ()
void setLayout (LoggerLayout $layout)
void setName (string $name)
void setThreshold (LoggerLevel|string $threshold)
void warn ( $message)
Variables
boolean $closed = false (line 34)

Set to true when the appender is closed. A closed appender will not accept any logging requests.

  • access: protected
LoggerFilter $filter (line 40)

The first filter in the filter chain.

  • access: protected
LoggerLayout $layout (line 47)

The appender's layout. Can be null if the appender does not use a layout.

  • access: protected
string $name (line 53)

Appender name. Used by other components to identify this appender.

  • access: protected
boolean $requiresLayout = true (line 70)

Set to true if the appender requires a layout.

True by default, appenders which do not use a layout should override this property to false.

  • access: protected

Redefined in descendants as:
LoggerLevel $threshold (line 60)

Appender threshold level. Events whose level is below the threshold will not be logged.

  • access: protected
Methods
Constructor __construct (line 76)

Default constructor.

  • access: public
LoggerAppender __construct ([string $name = ''])
  • string $name: Appender name

Redefined in descendants as:
activateOptions (line 258)

Prepares the appender for logging.

Derived appenders should override this method if option structure requires it.

  • access: public
void activateOptions ()

Redefined in descendants as:
addFilter (line 103)

Adds a filter to the end of the filter chain.

  • access: public
void addFilter (LoggerFilter $filter)
append (line 269)

Forwards the logging event to the destination.

Derived appenders should implement this method to perform actual logging.

  • abstract:
  • access: protected
void append (LoggerLoggingEvent $event)

Redefined in descendants as:
clearFilters (line 114)

Clears the filter chain by removing all the filters in it.

  • access: public
void clearFilters ()
close (line 277)

Releases any resources allocated by the appender.

Derived appenders should override this method to perform proper closing procedures.

  • access: public
void close ()

Redefined in descendants as:
doAppend (line 142)

Performs threshold checks and invokes filters before delegating logging to the subclass' specific append() method.

void doAppend (LoggerLoggingEvent $event)
getDefaultLayout (line 94)

Returns the default layout for this appender. Can be overriden by derived appenders.

  • access: public
LoggerLayout getDefaultLayout ()

Redefined in descendants as:
getFilter (line 123)

Returns the first filter in the filter chain.

The return value may be null if no is filter is set.

  • access: public
LoggerFilter getFilter ()
getFirstFilter (line 132)

Returns the first filter in the filter chain.

The return value may be null if no is filter is set.

  • access: public
LoggerFilter getFirstFilter ()
getLayout (line 176)

Returns the appender layout.

  • access: public
LoggerLayout getLayout ()
getName (line 205)

Retruns the appender name.

  • access: public
string getName ()
getThreshold (line 221)

Returns the appender's threshold level.

  • access: public
LoggerLevel getThreshold ()
isAsSevereAsThreshold (line 245)

Checks whether the message level is below the appender's threshold.

If there is no threshold set, then the return value is always true.

  • return: Returns true if level is greater or equal than threshold, or if the threshold is not set. Otherwise returns false.
  • access: public
boolean isAsSevereAsThreshold (LoggerLevel $level)
requiresLayout (line 197)

Configurators call this method to determine if the appender requires a layout.

If this method returns true, meaning that layout is required, then the configurator will configure a layout using the configuration information at its disposal. If this method returns false, meaning that a layout is not required, then layout configuration will be skipped even if there is available layout configuration information at the disposal of the configurator.

In the rather exceptional case, where the appender implementation admits a layout but can also work without it, then the appender should return true.

  • access: public
boolean requiresLayout ()
setLayout (line 166)

Sets the appender layout.

  • access: public
void setLayout (LoggerLayout $layout)
setName (line 213)

Sets the appender name.

  • access: public
void setName (string $name)
  • string $name
setThreshold (line 232)

Sets the appender threshold.

void setThreshold (LoggerLevel|string $threshold)
warn (line 282)

Triggers a warning for this logger with the given message.

  • access: protected
void warn ( $message)
  • $message

Redefinition of:
LoggerConfigurable::warn()
Triggers a warning.

Inherited Methods

Inherited From LoggerConfigurable

LoggerConfigurable::setBoolean()
LoggerConfigurable::setFileSize()
LoggerConfigurable::setInteger()
LoggerConfigurable::setLevel()
LoggerConfigurable::setNumeric()
LoggerConfigurable::setPositiveInteger()
LoggerConfigurable::setString()
LoggerConfigurable::warn()

Documentation generated on Sat, 18 Feb 2012 22:32:21 +0000 by phpDocumentor 1.4.3