Skip to content

Commit 0a807dc

Browse files
committed
Add logging when comment on news occurs
1 parent d5bfe3f commit 0a807dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/controllers/Comment/Create.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use \BNETDocs\Libraries\Controller;
88
use \BNETDocs\Libraries\Exceptions\CommentNotFoundException;
99
use \BNETDocs\Libraries\Exceptions\UnspecifiedViewException;
10+
use \BNETDocs\Libraries\Logger;
1011
use \BNETDocs\Libraries\Router;
1112
use \BNETDocs\Libraries\UserSession;
1213
use \BNETDocs\Models\Comment\Create as CreateModel;
@@ -87,6 +88,11 @@ protected function createComment(Router &$router, CreateModel &$model) {
8788
"parent_type" => $p_type
8889
];
8990

91+
Logger::logEvent(
92+
"comment_created_news", $model->user_session->user_id,
93+
getenv("REMOTE_ADDR"), json_encode($model->response)
94+
);
95+
9096
return 303;
9197
}
9298

0 commit comments

Comments
 (0)