Hi Bryan,
Well, let's see. This might be another case where something is crystal
clear to me but unfortunately not to anyone else. By default, WSTDERR
is connected to System.out, not System.err; so the two lines of code
below have precisely no effect. The manual ought to explicitly state
this, I think; there, I just added it.
Also, (and this the manual does say) Jess doesn't use "t" to print
watches and prompts and things; it uses "WSTDOUT". Jess also uses
"WSTDERR" to print error messages. So you want to attach these two
routers to System.err, like this:
PrintWriter err = new PrintWriter(System.err);
rete.addOutputRouter("WSTDOUT", err);
rete.addOutputRouter("WSTDERR", err);
rete.addOutputRouter("t", err);
Now, I don't know if this will properly connect to JServ's logs or
not, but at least you'll definitely have all the output going to
System.err.
I think Bryan Talbot wrote:
>
> I'm having strange behavior while running Jess 5.0 in a servlet (JServ with
> Sun JDK 1.2 on Redhat 6.1 with Apache) environment. I'd like the output
> streams of Jess to be routed to stderr for debugging; however, nothing shows
> up.
>
> The servlet engine routes System.out and System.err messages to a log file
> but nothing from Jess ever shows up. Messages from code all around calls to
> Jess are logged as expected.
>
> (watch all) has been enabled and I've attempted to muck with the output
> router with calls similar to:
>
> rete.removeOutputRouter( "t" );
> rete.addOutputRouter( "t", rete.getErrStream() );
>
> and some other combinations.
>
> Is there a known problem with output routers being routed to stderr when
> using this platform? Am I misunderstanding the documentation here?
>
> BTW, when running as an application, Jess outputs to the watch messages as
> expected, it's just while running as a servlet that I'm not seeing any
> messages.
>
>
> - -Bryan
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------