Browse Source

improved docs for #14273

tags/2.0.13
Carsten Brandt 7 years ago
parent
commit
9d854c0f25
No known key found for this signature in database
GPG Key ID: BE4F41DE1DEEEED0
  1. 10
      framework/log/Target.php

10
framework/log/Target.php

@ -313,6 +313,16 @@ abstract class Target extends Component
* Sets a value indicating whether this log target is enabled.
* @param bool|callable $value a boolean value or a callable to obtain the value from.
* The callable value is available since version 2.0.13.
*
* A callable may be used to determine whether the log target should be enabled in a dynamic way.
* For example, to only enable a log if the current user is logged in you can configure the target
* as follows:
*
* ```php
* 'enabled' => function() {
* return !Yii::$app->user->isGuest;
* }
* ```
*/
public function setEnabled($value)
{

Loading…
Cancel
Save