Author |
Message
|
lalli_urs |
Posted: Wed Dec 17, 2014 2:10 am Post subject: how to trace the java code logs in MB |
|
|
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 |
|
 |
kimbert |
Posted: Wed Dec 17, 2014 4:04 am Post subject: |
|
|
 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 |
|
 |
lalli_urs |
Posted: Wed Dec 17, 2014 4:15 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Wed Dec 17, 2014 4:21 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
lalli_urs |
Posted: Wed Dec 17, 2014 4:30 am Post subject: |
|
|
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 |
|
 |
mqjeff |
Posted: Wed Dec 17, 2014 5:58 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Wed Dec 17, 2014 9:14 am Post subject: |
|
|
 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 |
|
 |
|