Class TLogRouter

Description

TLogRouter class.

TLogRouter manages routes that record log messages in different media different ways. For example, a file log route TFileLogRoute records log messages in log files. An email log route TEmailLogRoute sends log messages to email addresses.

Log routes may be configured in application or page folder configuration files or an external configuration file specified by ConfigFile. The format is as follows,

  1. <route class="TFileLogRoute" Categories="System.Web.UI" Levels="Warning" />
  2. <route class="TEmailLogRoute" Categories="Application" Levels="Fatal" Emails="admin@pradosoft.com" />
You can specify multiple routes with different filtering conditions and different targets, even if the routes are of the same type.

  • since: 3.0
  • version: $Id: TLogRouter.php 2563 2008-11-11 10:03:41Z haertl.mike $
  • author: Qiang Xue <qiang.xue@gmail.com>

Located in /Util/TLogRouter.php (line 38)

TComponent
   |
   --TApplicationComponent
      |
      --TModule
         |
         --TLogRouter
Class Constant Summary
 CONFIG_FILE_EXT = '.xml'
Method Summary
void addRoute (TLogRoute $route)
void collectLogs (mixed $param)
string getConfigFile ()
void init (TXmlElement $config)
void setConfigFile (string $value)
Methods
addRoute (line 104)

Adds a TLogRoute instance to the log router.

  • access: public
  • throws: TInvalidDataTypeException if the route object is invalid
void addRoute (TLogRoute $route)
collectLogs (line 136)

Collects log messages from a logger.

This method is an event handler to application's EndRequest event.

  • access: public
void collectLogs (mixed $param)
  • mixed $param: event parameter
getConfigFile (line 115)
  • return: external configuration file. Defaults to null.
  • access: public
string getConfigFile ()
init (line 59)

Initializes this module.

This method is required by the IModule interface.

  • access: public
  • throws: TConfigurationException if ConfigFile is invalid.
void init (TXmlElement $config)
  • TXmlElement $config: configuration for this module, can be null

Redefinition of:
TModule::init()
Initializes the module.
setConfigFile (line 125)
  • access: public
  • throws: TConfigurationException if the file is invalid.
void setConfigFile (string $value)
  • string $value: external configuration file in namespace format. The file must be suffixed with '.xml'.

Inherited Methods

Inherited From TModule

TModule::getID()
TModule::init()
TModule::setID()

Inherited From TApplicationComponent

TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()

Inherited From TComponent

TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__get()
TComponent::__set()
Class Constants
CONFIG_FILE_EXT = '.xml' (line 43)

File extension of external configuration file

Documentation generated on Sun, 11 Jan 2009 20:23:06 -0500 by phpDocumentor 1.3.0RC4