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:
reqidis some random unique string for the transaction, e.g.
reqId=$(< /dev/urandom tr -dc A-Za-z0-9 | head -c20)
useris user, or none if script executed globally
appis an application name that works
urlbasically is the message body and here you can put whatever output you need
levelin your case could be
timeis a timestamp in standard
+%Y-%m-%dT%H:%M:%S%:zor customized in
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.