A Logger instance can be accessed via Yii::getLogger(). You can call the method Logger::log to record a single log message.
For convenience, a set of shortcut methods are provided for logging messages of various severity levels
via the [[Yii]] class:
- [[Yii::trace()]]
- [[Yii::error()]]
- [[Yii::warning()]]
- [[Yii::info()]]
- [[Yii::beginProfile()]]
- [[Yii::endProfile()]]
For more details and usage information on Logger, see the guide article on logging.
When the application ends or [[flushInterval]] is reached, Logger will call Logger::flush
to send logged messages to different log targets, such as [[FileTarget|file]], [[EmailTarget|email]],
or [[DbTarget|database]], with the help of the [[dispatcher]].