Quote:
Originally Posted by benoit
IceGrid uses the Ice.StdErr and Ice.StdOut properties to redirect the server output. The standard error/output is redirected by the server Ice communicator when it's initialized (with the java.lang.System.setOut/setErr methods). I suspect your prolog JNI library continues to log to the old stdout/stderr instead of using the new standard output/error.
|
Yes, it looks like that was the issue. Unfortunately, the way this application is written, it's not really practical to use a wrapper -- the main program is actually written prolog, and it initiates the Ice connection through Java after it's done its own initialisation.
For posterity, here's the solution I'm now using to capture all redirected output: after the Ice communicator has been initialised (in Java), I test whether the Ice.StdErr and/or Ice.StdOut properties exist. If they do, then I explicitly redirect the stderr and stdout in Prolog to files with similar names to the Ice files. (I originally thought of just redirecting prolog stdout to the *same* files, but that's probably a recipe for corrupting the output ...)
MEF