Regaez / grav-plugin-api

A REST API plugin for GravCMS
MIT License
27 stars 6 forks source link

feat: add logging for plugin #94

Open Regaez opened 4 years ago

Regaez commented 4 years ago

We should add a new configuration option that enables logging for all the API activity. The logs could be stored in /logs/api.log.

We should first investigate using the built-in $grav['log'] logger, but if that mixes the API logs with the other general Grav logs, then it might get confusing. At the very least, we should add in some identifier so that when reading the logs you know it was emitted by our plugin.

If the default Grav logger is not desirable, we could create a custom Monolog logger, like grav-plugin-email does.

Grav creates its own logger in a similar way.