LogTarget
- Type
- Class
- Namespace
- craft\debug
- Inherits
- craft\debug\LogTarget » yii\debug\LogTarget (opens new window) » yii\log\Target (opens new window) » yii\base\Component (opens new window) » yii\base\BaseObject (opens new window)
- Implements
- yii\base\Configurable (opens new window)
- Since
- 4.0.0
The debug LogTarget is used to store logs for later use in the debugger tool
View source (opens new window)
# Public Properties
Property | Description |
---|---|
behaviors (opens new window) | yii\base\Behavior (opens new window) – List of behaviors attached to this component. |
categories (opens new window) | array (opens new window) – List of message categories that this target is interested in. |
enabled (opens new window) | boolean (opens new window) – Indicates whether this log target is enabled. |
except (opens new window) | array (opens new window) – List of message categories that this target is NOT interested in. |
exportInterval (opens new window) | integer (opens new window) – How many messages should be accumulated before they are exported. |
levels (opens new window) | integer (opens new window) – The message levels that this target is interested in. |
logVars (opens new window) | array (opens new window) – List of the PHP predefined variables that should be logged in a message. |
maskVars (opens new window) | array (opens new window) – List of the PHP predefined variables that should NOT be logged "as is" and should always be replaced with a mask *** before logging, when exist. |
messages (opens new window) | array (opens new window) – The messages that are retrieved from the logger so far by this log target. |
microtime (opens new window) | boolean (opens new window) – Whether to log time with microseconds. |
module | craft\debug\Module |
prefix (opens new window) | callable (opens new window), null (opens new window) – A PHP callable that returns a string to be prefixed to every exported message. |
tag (opens new window) | string (opens new window) |
# module
- Type
- craft\debug\Module
- Default value
null
View source (opens new window)
# Public Methods
Method | Description |
---|---|
__call() (opens new window) | Calls the named method which is not a class method. |
__clone() (opens new window) | This method is called after the object is created by cloning an existing one. |
__construct() (opens new window) | |
__get() (opens new window) | Returns the value of a component property. |
__isset() (opens new window) | Checks if a property is set, i.e. defined and not null. |
__set() (opens new window) | Sets the value of a component property. |
__unset() (opens new window) | Sets a component property to be null. |
attachBehavior() (opens new window) | Attaches a behavior to this component. |
attachBehaviors() (opens new window) | Attaches a list of behaviors to the component. |
behaviors() (opens new window) | Returns a list of behaviors that this component should behave as. |
canGetProperty() (opens new window) | Returns a value indicating whether a property can be read. |
canSetProperty() (opens new window) | Returns a value indicating whether a property can be set. |
className() (opens new window) | Returns the fully qualified name of this class. |
collect() (opens new window) | Processes the given log messages. |
detachBehavior() (opens new window) | Detaches a behavior from the component. |
detachBehaviors() (opens new window) | Detaches all behaviors from the component. |
ensureBehaviors() (opens new window) | Makes sure that the behaviors declared in behaviors() (opens new window) are attached to this component. |
export() | Exports log messages to a specific destination. |
filterMessages() (opens new window) | Filters the given messages according to their categories and levels. |
formatMessage() (opens new window) | Formats a log message for display as a string. |
getBehavior() (opens new window) | Returns the named behavior object. |
getBehaviors() (opens new window) | Returns all behaviors attached to this component. |
getEnabled() (opens new window) | Check whether the log target is enabled. |
getLevels() (opens new window) | |
getMessagePrefix() (opens new window) | Returns a string to be prefixed to the given message. |
hasEventHandlers() (opens new window) | Returns a value indicating whether there is any handler attached to the named event. |
hasMethod() (opens new window) | Returns a value indicating whether a method is defined. |
hasProperty() (opens new window) | Returns a value indicating whether a property is defined for this component. |
init() (opens new window) | Initializes the object. |
loadManifest() | |
loadTagToPanels() | |
off() (opens new window) | Detaches an existing event handler from this component. |
on() (opens new window) | Attaches an event handler to an event. |
setEnabled() (opens new window) | Sets a value indicating whether this log target is enabled. |
setLevels() (opens new window) | Sets the message levels that this target is interested in. |
trigger() (opens new window) | Triggers an event. |
# export()
Exports log messages to a specific destination.
Child classes must implement this method.
View source (opens new window)
Throws
# loadManifest()
View source (opens new window)
Returns
# loadTagToPanels()
View source (opens new window)
Arguments
$tag
Returns
# Protected Methods
Method | Description |
---|---|
collectSummary() (opens new window) | Collects summary data of current request. |
gc() | Removes obsolete data files |
getContextMessage() (opens new window) | Generates the context information to be logged. |
getSqlTotalCount() (opens new window) | Returns total sql count executed in current request. If database panel is not configured returns 0. |
getTime() (opens new window) | Returns formatted ('Y-m-d H:i:s') timestamp for message. |
removeStaleDataFiles() | Remove staled data files i.e. files that are not in the current index file (may happen because of corrupted or rotated index file) |
# gc()
Removes obsolete data files
View source (opens new window)
Arguments
$manifest
(array (opens new window))
# removeStaleDataFiles()
Remove staled data files i.e. files that are not in the current index file (may happen because of corrupted or rotated index file)
View source (opens new window)
Arguments
$manifest
(array (opens new window))