mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 11:39:41 +08:00
Merge branch 'security'
This commit is contained in:
@ -216,6 +216,17 @@ You may configure `logVars` to be an empty array to totally disable the inclusio
|
||||
Or if you want to implement your own way of providing context information, you may override the
|
||||
[[yii\log\Target::getContextMessage()]] method.
|
||||
|
||||
In case some of your request fields contain sensitive information you would not like to log (e.g. passwords, access tokens),
|
||||
you may additionally configure `maskVars` property. By default, the following request parameters will be masked with `***`:
|
||||
`$_SERVER[HTTP_AUTHORIZATION]`, `$_SERVER[PHP_AUTH_USER]`, `$_SERVER[PHP_AUTH_PW]`, but you can set your own:
|
||||
|
||||
```php
|
||||
[
|
||||
'class' => 'yii\log\FileTarget',
|
||||
'logVars' => ['_SERVER'],
|
||||
'maskVars' => ['_SERVER.HTTP_X_PASSWORD']
|
||||
]
|
||||
```
|
||||
|
||||
### Message Trace Level <span id="trace-level"></span>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user