Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
root
Creator II
Creator II

Capture System.out.println output in tesb.log

In my TOS ESB tRestRequest/ tRestResponse job, I have put in a few debug statements using System.out.println(). These show up when I am running the Runtime container using ./trun

 

However, when I start the Runtime container using ./start, these logs do not appear and neither are they logged in the <RunTimeContainer>/log/tesb.log file

 

How can I capture that information? Please help. This has been driving me crazy for the past few days.

 

Thank you.

Labels (2)
17 Replies
Anonymous
Not applicable

Hi,

 

Could you try with log.info() ?

 

Eric

root
Creator II
Creator II
Author

Umm, Do I need to import any libraries? log.info() gives me.. Any example will be helpful. Or any other way in which I can capture the console details in tesb.log

log cannot be resolved
Anonymous
Not applicable

In a tJavaRow, I just enter:

 log.info("This is a test");

 

In your job code, don't you see these java lines:

if (!"".equals(log4jLevel)) {
if ("trace".equalsIgnoreCase(log4jLevel)) {
log.setLevel(org.apache.log4j.Level.TRACE);
} else if ("debug".equalsIgnoreCase(log4jLevel)) {
log.setLevel(org.apache.log4j.Level.DEBUG);

...

 

Eric

root
Creator II
Creator II
Author

So, what do I need to initialize "log" in my code?
Anonymous
Not applicable

I don't know... If I create a job without any component, I already have this code piece...

root
Creator II
Creator II
Author

wow, for me, it says "log cannot be resolved". Can you check someother component in your design and see where its instantiated please?
Anonymous
Not applicable

What version of Talend are you using @mbocquet? If you go to your "Code" tab which shows you the autogenerated Java code for your job, you should see some code that looks like this....

 

//GetFileDetails.class is the name of the job 
private static org.apache.log4j.Logger log = org.apache.log4j.Logger .getLogger(GetFileDetails.class);

My suspicion is that you are not using v6. 

 

 

Anonymous
Not applicable

You can potentially get around this (I've not tried this since I do not have a version without this on my current machine) by adding the relevant Jar using a tLibraryLoad and using the following code....

org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("MyLog");

I'd be interested to see if this works. As I said, I would have tried this myself but the version I am using has this.

 

Another possibility could be that this is functionality left out of the open source edition.

root
Creator II
Creator II
Author

@rhall:

I am using TESB Open Studio V 6.3.1. Is that a problem?