Thank you for pyjnius
I have been successfully using it to write Python scripts which call a (proprietary) Java API. No problems so far, but one minor annoyance: whenever I initialize their API they send a lot of info to stdout which gets lost because (in production) the script is run on a headless server. Similarly, when I cause a crash in their API the stack dump gets written to Java's stderr and also lost.
So far I've been working around this by running from a top level bash script and redirecting at that level, but that loses context - e.g. for a stackdump I get the Java trace in one log, and the subsequent Python traceback in another.
I'd much prefer to capture Java's stdout/err from within the Python script and send it to my normal Python logging. Is this possible?