Add Logging to WordPress in 3 Minutes with this Simple Plugin

Add logging to WordPress WP Logger

One of the best things about WordPress is that it’s easy to use. However, when things get complicated or not ordinary, we need a way to debug. The default WordPress debug log requires you to set the entire website on Debug mode and for a Production website or live once it’s an overhead. But what if there was a different way? How can you quickly add logging to WordPress?

One day I was trying to connect a website with an email list provider when it occurred to me that the process of registering new users for my WooCommerce store may be failing. This could be due to intermittent errors, so I needed a way to find where things are going wrong quickly.

A quick search online brought me to this little plugin, called (surprisingly enough) WP Logger, which lets you add logging to WordPress by creating a new table in your database and allows you to log from anywhere in your code using this simple hook:

So how do I add logging to WordPress?

This will be available to see on your dashboard under Tools -> Logger. You could filter the logs saved in the Database, see all the information, and sort the records.

Add logging to WordPress with WP Logger dashboard

For an even better search when you want to add logging to WordPress, you can filter logs based on priority and status. For example, if I was looking for an error that occurred a few days ago, I could type:

					do_action( 'logger', $data, 'warning' );
do_action( 'logger', $data, 'error' );

Which can classify the logs saved in your database by priority for easier search and filtering later on.

What's the bottom line?

This logging system is, however, is a good solution to add logging to WordPress only for small-scale logging and low throughput. If you run a small e-commerce website or a blog, it’s the easiest and fastest way to log. On the other hand, if that’s not the case, I would go for more robust solutions. Such a solution could be using Logstash with Adapteus, but it requires more advanced coding skills. Otherwise, I think it’s a great and easy solution to add logging to WordPress in minutes.

If you’re reading this article, I’m guessing you’re a techy guy. One of the things I love is to use technology to boost my website performance. Lately, I’ve been using this AMAZING AI-powered content generator to improve almost every single word on my website. It’s completely nuts!

I really recommend you check it out – or at least go through this list of AI-powered marketing copy tools for your own site. You won’t believe how much time and effort you will save with it. I was skeptical in the beginning, but now I’m all in, check it out too!

Join The New Economy.
Starting Today.

Get my updates on the latest in Web3, NFT, and crypto.

Guy Eshet

Guy Eshet

Guy Eshet is an expert in Blockchain technologies, NFTs, and Web development. Guy has been developing software for over 15 years, recently focusing on Web3. He's always looking for ways to simplify our lives, at the leading edge of technology. Guy is fluent in 5 languages, loves meeting new people, learning about various topics, and improving his skills.

Share this article!

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp

Leave a Reply

Your email address will not be published.

geshet io guy eshet web3 expert and crypto expert

Be The First To Know!

Discover The Hottest Crypto & AI Tools