FileLogRoute

Type
Class
Namespace
Craft
Inherits
Craft\FileLogRoute » CFileLogRoute » CLogRoute » CComponent
Since
1.0

Class FileLogRoute

See also http://craftcms.com

View source

Public Properties

PropertyDescription
$categoriesmixed – Array of categories, or string list separated by comma or space.
$enabledboolean – Whether to enable this log route.
$exceptmixed – Array of categories, or string list separated by comma or space, to EXCLUDE from logs.
$filtermixed – The additional filter (eg {@link CLogFilter}) that can be applied to the log messages.
$levelsstring – List of levels separated by comma or space.
$logsarray – The logs that are collected so far by this log route.
$rotateByCopyboolean – Whether to rotate primary log by copy and truncate which is more compatible with log tailers.

Public Methods

MethodDescription
__call()Calls the named method which is not a class method.
__get()Returns a property value, an event handler list or a behavior based on its name.
__isset()Checks if a property value is null.
__set()Sets value of a component property.
__unset()Sets a component property to be null.
asa()Returns the named behavior object.
attachBehavior()Attaches a behavior to this component.
attachBehaviors()Attaches a list of behaviors to the component.
attachEventHandler()Attaches an event handler to an event.
canGetProperty()Determines whether a property can be read.
canSetProperty()Determines whether a property can be set.
collectLogs()Retrieves filtered log messages from logger for further processing.
detachBehavior()Detaches a behavior from the component.
detachBehaviors()Detaches all behaviors from the component.
detachEventHandler()Detaches an existing event handler.
disableBehavior()Disables an attached behavior.
disableBehaviors()Disables all behaviors attached to this component.
enableBehavior()Enables an attached behavior.
enableBehaviors()Enables all behaviors attached to this component.
evaluateExpression()Evaluates a PHP expression or callback under the context of this component.
getEventHandlers()Returns the list of attached event handlers for an event.
getLogFile()
getLogPath()
getMaxFileSize()
getMaxLogFiles()
hasEvent()Determines whether an event is defined.
hasEventHandler()Checks whether the named event has attached handlers.
hasProperty()Determines whether a property is defined.
init()Initializes the log route. This method is invoked after the log route is created by the route manager.
raiseEvent()Raises an event.
setLogFile()
setLogPath()
setMaxFileSize()
setMaxLogFiles()

init()

Initializes the log route. This method is invoked after the log route is created by the route manager.

View source

Returns

null

Signature

public null init ( )

Protected Methods

MethodDescription
formatLogMessage()Formats a log message given different fields.
formatLogMessageWithForce()Formats a log message given different fields.
processLogs()Saves log messages in files.
rotateFiles()Rotates log files.

formatLogMessageWithForce()

Formats a log message given different fields.

View source

Arguments

  • $message (string) – The message content.
  • $level (integer) – The message level.
  • $category (string) – The message category.
  • $time (integer) – The message timestamp.
  • $force (boolean) – Whether the message was forced or not.

Returns

string – The formatted message.

Signature

protected string formatLogMessageWithForce ( $message, $level, $category, $time, $force )

processLogs()

Saves log messages in files.

View source

Arguments

  • $logs (array) – The list of log messages

Returns

null

Signature

protected null processLogs ( $logs )