Log REST API calls

I still learning about Yii’s REST API, and i found this for security.

Was wondering if Yii had a built in feature to log API calls? Or do i have to create my own in beforeAction() of yii\rest\ActiveController ?

Is there already an extension someone built for this by any chance? Or
Is there a better way than using beforeAction()?


1 Like

Hi @shaho

Yii already has a built-in logging framework.
Usually you have to

  1. configure logging module
  2. log messages wherever you want to

and, that’s all.

To log systematically on every rest api call, you still need to add a behavior to call the logs, right?