How do I write to the log?

I feel stupid for even asking, but how can I get my API code to write debug logs? The docs here are remarkably obtuse.

Yeah, a bit of reverse engineering needed. Basically it is JSON, but with few mandatory fields, e.g. example from preview generator:


  • reqid is some random unique string for the transaction, e.g. reqId=$(< /dev/urandom tr -dc A-Za-z0-9 | head -c20)
  • user is user, or none if script executed globally
  • app is an application name that works
  • url basically is the message body and here you can put whatever output you need
  • level in your case could be debug
  • time is a timestamp in standard +%Y-%m-%dT%H:%M:%S%:z or customized in config.php format.


Sorry, I see that you asked from the PHP api…

Hah yes, in the PHP code. I was trying to add some debugging to the REST API controller, but can’t figure out how to get access to the $logger. I made do with throwing an exception, but that’s going to make debugging harder.