Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Redirect JNI C stderr / stdout to System.stdout and System.stderr

843829Feb 20 2008 — edited Feb 20 2008
We use log4j in java to log everything output to stdout and stderr - however, we also have a JNI DLL which writes to the C stderr/stdout. These are not caught by log4j and just get output to the console.

Is there any way to force a C call to printf("...") to go through the standard Java streams? Most of the calls are actually to fprintf(stdout, "..."), so if I can use a file that would also be acceptable.

Thanks in advance,

Bob
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 19 2008
Added on Feb 20 2008
1 comment
6,543 views