I can't think of a way to directly add output to the backend server logs. Nor does the code-executor have any public endpoints, as far as I know. Most of the built-in features that come to mind are scoped to the Enterprise plan - observability integration and error event handling, specifically.
Is your org streaming and parsing server logs internally for the purpose of analytics? Is there a particular reason you're interested in connecting to the code-executor, in particular?
Yes, my org uses server logs internally for the purpose of analytics. I want to be able to log to the standard out from app queries. This seems to be possible using the analytics queries, so I wanted to use this same behavior for other queries (ex: JS queries)
Makes sense! I'm pretty sure the analytics query is going to be your best bet, then. For your particular use case, would it work to define a single generic analytics query that you can then trigger via another query's failure handler? You can trigger it with additionalScope in order to dynamically pass in a payload that is relevant to the current error being handled.
I do like the idea of a built-in utility function that would make this easier, but I'm not sure how feasible it would be, given that its usefulness would be scoped entirely to the self-hosted product. It's probably worth bringing up to the team, though!