Posts

Showing posts from February, 2015

Reassign stdout and stderr to BW logger

There are instances when you are using a third party Java class and you want to debug certain errors, but you couldn't get the error stack traces in the logs particularly in the application logs which you can also view via TIBCO Administrator (assuming you have no server-level access). There's no way you can change the Java class to add a custom log4j logger such as "bw.logger" in order to write into the BW log file. You know for certain that the Java class writes debug logs into the standard output and error stream (e.g. System.out and System.err). You can reassign standard and error output stream and into the BW log file by writing a custom Java code. Since these are static methods and a service instance runs in its own JVM, you only have to run this code once as part of a process starter (process definition with onStartup). Create a static Logger object (class org.apache.log4j.Logger). private static final Logger logger = Logger.getLogger("bw.log