Whenever I’m working on a project, I often have WordPress set in debug mode, and I like to write messages to the error log that I can easily view, trace, and follow whenever I’m working on a project.
When I do this, there are two ways (and it just depends on the project):
- I’ll use a library such as Monolog,
- I’ll use my own, simple log function.
In this post, I’m going to cover the latter. That is, I’m going to share how I write messages to the WordPress debug log and then some of the things you may need to pay attention to whenever you’re doing the same.