Class 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.
Method Summary |
void
|
Adds a TLogRoute instance to the log router.
|
void
|
Collects log messages from a logger.
|
string
|
|
void
|
Initializes this module.
|
void
|
|
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
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
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'
|
|