Commit 0acbc1acf1754544df4d80b113dbad102704ca30
1 parent
92e6e7c0
-Before action added
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
backend/controllers/CallController.php
@@ -26,17 +26,17 @@ | @@ -26,17 +26,17 @@ | ||
26 | ); | 26 | ); |
27 | } | 27 | } |
28 | 28 | ||
29 | - public function afterAction($action, $result) | 29 | + public function beforeAction($action) |
30 | { | 30 | { |
31 | - if ($action === 'create') { | 31 | + if ($action->id === 'create') { |
32 | $monologComponent = \Yii::$app->monolog; | 32 | $monologComponent = \Yii::$app->monolog; |
33 | $logger = $monologComponent->getLogger(); | 33 | $logger = $monologComponent->getLogger(); |
34 | /** | 34 | /** |
35 | * @var \Psr\Log\LoggerInterface $logger | 35 | * @var \Psr\Log\LoggerInterface $logger |
36 | */ | 36 | */ |
37 | - $logger->info('Create action trigered, ip: ' . \Yii::$app->request->getRemoteIP()); | 37 | + $logger->info('Before reate action trigered, ip: ' . \Yii::$app->request->userIP . ', request body: ' . \Yii::$app->request->rawBody); |
38 | } | 38 | } |
39 | 39 | ||
40 | - return parent::afterAction($action, $result); | 40 | + return parent::beforeAction($action); |
41 | } | 41 | } |
42 | } | 42 | } |
43 | \ No newline at end of file | 43 | \ No newline at end of file |