Skip to Content
author's profile photo
Former Member

Where does System.out.println go?

Hi Everyone: I know I've seen this topic before, but I'm still having some trouble. I would like to debug my EJBs, and so I've added some System.out.println statements to them. Where does that go? I've looked at the defaultTrace.trc files in the

C:\usr\sap\P48\JC00\j2ee\cluster\server0\log

folder, and haven't found any of the text that I think I am writing. I appreciate any guidance! Ian.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    author's profile photo
    Former Member
    Oct 06, 2005 at 08:23 AM

    Hi lan,

    I was facing the same question earlier, and now I think I have figured out one possible answer. Actually, where the System.out.println goes is up to the Server Admin to config. There is a default SYSTEM.OUT log controller ( under location controller side) pre-defined to cater for all System.out.println(). All the System.out.println() output is considered as INFO type log message. However, this default SYSTEM.OUT controller is not assigned with any real log destination, thus, we cannot find the output anywhere.

    If you goes to the log configurator (using Visual Admin), you can locate this SYSTEM.OUT controller , and add in a default (Anonymous) destionation for it . (you need to toggle on the advance edit mode from the top menu , then you can add modify the destination settings of a Controller).

    For Anonymous destionation, the println() output will sure go to the defaultTrace.trc (better view it using Log Viewer, instead of viewing it from the log file ).

    Or , you can define a separate file (e.g. c:\temp\myStd.log ) as the log destination ..

    Last but not the least, you need to set the ForceSingleTraceFile setting from 'YES' to 'NO' , then you can see your "myStd.log".

    To change the ForceSingleTraceFile , go to Visual Admin, J2EE server --> Kernel --> LogManager.

    Hope you find the above useful.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 28, 2005 at 05:58 PM

    Hi Ian,

    If you want to see what you are writing in the <b>defaultTrace.trc files</b> then instead of wrting System.out.println() you have to write <b>System.err.println();</b>

    For eg, I am showing you the catch block of a code:

    <b>

    catch(Exception e)

    {

    <b>System.err.println("This is the error Statement" +e);</b>

    }

    </b>

    Now when you will view this defaultTrace.trc file at the location C:\usr\sap\P48\JC00\j2ee\cluster\server0\log you will find what ever you have written in the System.err.println() statement.

    I hope this solves your problem.

    Regards

    Pravesh

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 07:07 AM

    Hi Ian,

    Why don't you try this option

    debugging option

    in NWDS ->Windows->show view->debug break point

    hope this helps you

    Regards,

    RK

    Add comment
    10|10000 characters needed characters exceeded