We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yii\log\Target::$maskVars
Let's assume that I have the following configuration:
// config/components/log.php return [ 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error', 'warning'], 'maskVars' => [ '_SERVER.AUTH_GOOGLE_TOKEN', '_SERVER.AUTH_FACEBOOK_TOKEN', '_SERVER.AUTH_TWITTER_TOKEN', '_SERVER.AUTH_GITHUB_TOKEN', '_SERVER.AUTH_APPLE_TOKEN', '_SERVER.AUTH_MICROSOFT_TOKEN', '_SERVER.AUTH_MICROSOFT_TOKEN', // ... '_POST.LoginForm.password', '_POST.ChangePassword.password', '_POST.ResetPasswordForm.password', '_POST.ResetPasswordForm.password_repeat', // ... ] ] ] ]
And the context information to be logged respectively:
$_SERVER = [ 'AUTH_GOOGLE_TOKEN' => '***', 'AUTH_FACEBOOK_TOKEN' => '***', 'AUTH_TWITTER_TOKEN' => '***', 'AUTH_GITHUB_TOKEN' => '***', 'AUTH_APPLE_TOKEN' => '***', 'AUTH_MICROSOFT_TOKEN' => '***', 'AUTH_MICROSOFT_TOKEN' => '***', ] $_POST = [ 'LoginForm' => [ 'password' => '***', ], 'ResetPasswordForm' => [ 'password' => '***', 'password_repeat' => '***', ] ]
But what if instead of tens (or hundreds) predefined variables we will only have a few entries, e.g.
'maskVars' => [ '_SERVER.*TOKEN', '_POST.*.password', ]
Is it worth it? Would be convenient, huh?
The text was updated successfully, but these errors were encountered:
👍 Indeed, it would be convenient. Do you have time for a pull request?
Sorry, something went wrong.
Yeah, sure. I'll do my best.
An ability to have wildcards in yii\log\Target::$maskVars array yii…
6cb2c8b
…soft#20295
Update documentation and annotation related to $maskVars property y…
$maskVars
47e4c11
…iisoft#20295
Added documentation in Russian language regarding the $maskVars pro…
15e2291
…perty yiisoft#20295
No branches or pull requests
Let's assume that I have the following configuration:
And the context information to be logged respectively:
But what if instead of tens (or hundreds) predefined variables we will only have a few entries, e.g.
Is it worth it? Would be convenient, huh?
The text was updated successfully, but these errors were encountered: