- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml
Classes:
TBrowserLogRoute
TDataFieldAccessor
TDateTimeStamp
TDbLogRoute
TEmailLogRoute
TFileLogRoute
TFirebugLogRoute
TFirePhpLogRoute
TLogger
TLogRoute
TLogRouter
TParameterModule
TSimpleDateFormatter
TVarDumper

Keyword

# Class TLogRouter

    TComponent
       |
       --TApplicationComponent
          |
          --TModule
             |
             --TLogRouter

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,

       <route class="TFileLogRoute" Categories="System.Web.UI" Levels="Warning" />
       <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
Author: Qiang Xue <qiang.xue@gmail.com>

Method Summary
void | addRoute ( TLogRoute $route) Adds a TLogRoute instance to the log router.
void | collectLogs ( mixed $param) Collects log messages from a logger.
string | getConfigFile ()
void | init ( TXmlElement $config) Initializes this module.
void | setConfigFile ( string $value)

Methods Inherited From TModule
TModule::getID(), TModule::init(), TModule::setID()

Methods Inherited From TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()

Methods 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()

Constant Summary
string | CONFIG_FILE_EXT | File extension of external configuration file

Method Details

## addRoute

public void addRoute | (TLogRoute $route )

Adds a TLogRoute instance to the log router.

Input
TLogRoute | $route |
Output
Exception
throws | TInvalidDataTypeException if the route object is invalid

## collectLogs

public void collectLogs | (mixed $param )

Collects log messages from a logger.

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

Input
mixed | $param | event parameter
Output
Exception

## getConfigFile

public string getConfigFile | ()

Output
string | external configuration file. Defaults to null.
Exception

## init

public void init | (TXmlElement $config )

Initializes this module.

This method is required by the IModule interface.

Input
TXmlElement | $config | configuration for this module, can be null
Output
Exception
throws | TConfigurationException if ConfigFile is invalid.

## setConfigFile

public void setConfigFile | (string $value )

Input
string | $value | external configuration file in namespace format. The file must be suffixed with '.xml'.
Output
Exception
throws | TConfigurationException if the file is invalid.

Constant Details

### CONFIG_FILE_EXT

File extension of external configuration file

#### Type:

string

#### Value:

'.xml'