Does WordPress provide different levels of logging?


(I come from a Java development background, so please excuse my lack of PHP and WordPress knowledge.)

My understanding of logging in WordPress is that it must first be enabled in wp-config.php and then calls to error_log() can be seen and read.

But logging is not just about errors. It is very useful when developing and debugging to be able to log. For this reason many Java logging libraries (e.g. SLF4J) provide the ability to log at the following levels:

  • TRACE (lowest)
  • INFO
  • WARN
  • ERROR (highest)

You can then configure the logging level that you wish to see in the log. For example when developing you would like to see DEBUG and above, but when running in production you probably just want to see WARN and above.

Is there something equivalent in WordPress? Logging everything as an error does not seem right.

vegemite4me 4 months 0 Answers 11 views 0

Leave an answer