How to store plugins or themes logs?

Let’s see which standard we follow to store logs for our development

Logs are important pieces of information when executing specific task of synchronization or event based.

At Maras IT, we have our own “.marasit” directory which help us maintain important data without disrupting the WordPress ecosystem.

In order to make it easy to find back which log come from which peace of code and where did we store those logs without the need of looking into the code, we have defined the following pattern

  • All logs goes to .marasit/log/
  • Theme logs goes to .marasit/log/wp-content/themes/theme-slug/*.log
  • Plugin logs goes to .marasit/log/wp-content/plugins/plugin-slug/*.log

We keep the wp-content structure, in case we need to build logs for custom code that live in the directories outside or plugins or themes.

Good coding !