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 » how to trace the java code logs in MB

Post new topic  Reply to topic
 how to trace the java code logs in MB « View previous topic :: View next topic » 
Author Message
lalli_urs
PostPosted: Wed Dec 17, 2014 2:10 am    Post subject: how to trace the java code logs in MB Reply with quote

Novice

Joined: 10 Nov 2010
Posts: 10

Hi,

I am calling a java class from a ESQL procedure and this procedure is returning me some error, so I want to find where exactly the code is throwing the error.

The entire java code is in try block and in the catch block the below code is written.

catch (Exception e) {
e.printStackTrace();
exceptionString = e.toString();
System.err.println(e.toString());
}

printStackTrace is used to find the extract location of the error but I am not sure where this will be logged in the message broker.


Can you please help me on this???
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Dec 17, 2014 4:04 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I would set the Java debug port and then attach a Java debugger.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
lalli_urs
PostPosted: Wed Dec 17, 2014 4:15 am    Post subject: Reply with quote

Novice

Joined: 10 Nov 2010
Posts: 10

I have never done this before. Can you brief me the steps that I need to follow ???

Note: I am using Message Broker 7.0.


Last edited by lalli_urs on Wed Dec 17, 2014 4:22 am; edited 1 time in total
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Dec 17, 2014 4:21 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Read the documentation:
http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ag11370_.htm
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
lalli_urs
PostPosted: Wed Dec 17, 2014 4:30 am    Post subject: Reply with quote

Novice

Joined: 10 Nov 2010
Posts: 10

Thanks!!

The issue I am currently facing is not happening continuously. So I want to enable the traces for 2 hours and it can record the logs in a text file. Just like ESQL tracing by using commands (Mqsichangetrace, mqsireadlog, mqsiformatlog).

I believe by using the above link I can debug but I want to trace the logs in a file. Can you please explain me how can I do this??
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Dec 17, 2014 5:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Are you asking where System.err.println writes to?

It writes to standard error.

This is saved to a file, in a different place on windows or Unix.

On windows, the name of the file is console.txt. On unix, it is named stderr (maybe with a postfix, I've forgotten).
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Dec 17, 2014 9:14 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
The issue I am currently facing is not happening continuously. So I want to enable the traces for 2 hours and it can record the logs in a text file
You said that you are trying to trap an exception. The Eclipse Java debugger allows you to set an 'exception breakpoint' so that when an exception is thrown, you get to see it immediately. You can easily run for 2 hours or more with the exception trap active.
Why is logging to a text file a better solution?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » how to trace the java code logs in MB
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.