Six Stars

Disable default System.out.println statements

Hi,

 

I am checking if there is a way to disable System.out.println logs that generated  by default in talend. In my case, i am using the tmomInput and for errorhandling am obliged to use a tmomoutput to capture and send the message to another queue . Everything works as expected ,except that I get this "Disconnecting Queue"statement eventhough the message doesn't pass through the reject link. When there are 50000 or even 100000 messages, i get the same number of Disconnecting Queue statements. Is there a way to overcome this situation?

 

Code Snippet (I see this in the generated java code, but i am not able to comment or disable this)

currentComponent = "tMomOutput_1";
System.out.println("Disconnecting queue");
remoteQ_tMomOutput_1.close();

 

 

[statistics] connecting to socket on port 3626
[statistics] connected
Ready to receive message
Waiting...
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue
Disconnecting queue

1 ACCEPTED SOLUTION

Accepted Solutions
Fifteen Stars

Re: Disable default System.out.println statements

You can't really disable the System.out code as such, but you can disable the mechanism that prints them. Add a tJava to the beginning of your job (the first component) and put this code in it.....

 

System.setOut(new  java.io.PrintStream(new  java.io.OutputStream() {
                public void write(int b) {
                    //DO NOTHING
                }
            }));

You will no longer get those lines printed.......but you won't get anything else from the System.out either.

Rilhia Solutions
1 REPLY
Fifteen Stars

Re: Disable default System.out.println statements

You can't really disable the System.out code as such, but you can disable the mechanism that prints them. Add a tJava to the beginning of your job (the first component) and put this code in it.....

 

System.setOut(new  java.io.PrintStream(new  java.io.OutputStream() {
                public void write(int b) {
                    //DO NOTHING
                }
            }));

You will no longer get those lines printed.......but you won't get anything else from the System.out either.

Rilhia Solutions