ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Debugging using "System.out.println" from Java Com

Post new topic  Reply to topic
 Debugging using "System.out.println" from Java Com « View previous topic :: View next topic » 
Author Message
pmarie
PostPosted: Fri Aug 02, 2019 5:05 am    Post subject: Debugging using "System.out.println" from Java Com Reply with quote

Novice

Joined: 04 Apr 2002
Posts: 23

I need to write data into a log file using "System.out.println" from the Java code of Java Compute nodes (I use IIB v10 and the integration server runs on Linux RH).
This used to be possible with setting "MQSI_RUN_ATTACHED=1" and restarting the integration server, but I was not able to make it work.
Is it still supported in IIB v10? Is there another way?
Back to top
View user's profile Send private message
pmarie
PostPosted: Fri Aug 02, 2019 6:16 am    Post subject: Reply with quote

Novice

Joined: 04 Apr 2002
Posts: 23

I used the following method as a workaround:

public static void logMessage(String msg) {
String logFile = "/tmp/iibLogFile.log";

java.io.FileWriter fw = null;
java.io.BufferedWriter bw = null;
java.io.PrintWriter pw = null;

try {
fw = new FileWriter(logFile, true);
bw = new BufferedWriter(fw);
pw = new PrintWriter(bw);
pw.println(msg);
pw.flush();
} catch(IOException e) {
} finally {
try {
if (pw != null) pw.close();
if (bw != null) bw.close();
if (fw != null) fw.close();
} catch(IOException e) {}
}
}
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Aug 06, 2019 5:05 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

You might be better off just using java.util.logging with a file appender...
A lot less to manage, and to close...

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Debugging using "System.out.println" from Java Com
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.