A
A
akula222016-12-13 15:03:34
Yii
akula22, 2016-12-13 15:03:34

How to add your information to the logs?

I have this configuration

'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                'access' => [
                    'class' => 'app\components\DBLog',
                    'levels' => ['info', 'warning'],
                    'categories' => ['access'],
                    'logVars' => ['_POST', '_GET'],
                ],

I will add logs like this Yii::info(__METHOD__, 'access');
but in the authorization code, I want to add some more information. and in particular the moderator's browser which logs in.
How can I do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
melnikov_m, 2016-12-13
@akula22

as an option, store this information in the session, and then output the session to the logs
'logVars' => ['_POST', '_GET', '_SESSION'],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question