1) Programmatically, you can call Tibjms.setTraceFile() with the fileName from your application code. However, this is not practical since in most cases the client application is not a simple Java client that can be changed as needed.
2). Set the JVM property -Dtibco.tibjms.trace.file .
Example: java -Dtibco.tibjms.trace.file=/tmp/trace tibjmsMsgConsumer
This will redirect the client trace to /tmp/trace file.