Announcement Announcement Module
Collapse
No announcement yet.
Where's my stdout and stderr? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Where's my stdout and stderr?

    When developing with standard Eclipse (or MyEclipse) and Tomcat, I've become very used to my stdout and stderr streams being sent to the Eclipse console window. stdout shows up in black, and stderror shows up in red. The console window hyperlinks stack traces to jump right to the code.

    In STS 2.2.0 and dm Server 2.0 M6, when I do a System.out.println or System.err.println from any of my bundles it appears the ouput is being swallowed. I don't see the output in any file on my hard-drive and its not showing up in the console.

    I see System.out and System.err have been replaced by a com.springsource.osgi.medic.log.impl.LoggingPrintS treamWrapper, but since the source code isn't attached to the server by default I can't step through it to find out where that code is going.

    As well, I checked the "Tail applicaiton trace files into Console view" and that doesn't appear to be working. The trace files content doesn't appear in the console.

    If you'd like me to write up a JIRA, it would be simple:
    1) please send stdout to the STS console in black text
    2) please send stderr to the STS console in red text
    3) please ensure that the stacktraces dumped out are hyperlinked and jumping to the code that is hyperlinked works properly for all items in the stack trace

    I think all of these are standard Eclipse behavior, you just have to get STS and dm Server to play well together.

    Also, beware, if you haven't found it already there's a method in org.apache.catalina.startup.Embedded.java called initStreams() which redirects System.out and System.err to a SystemLogHandler and thus messes up the stderr displayed in red thing. You need to set Embedded.redirectStreams to false in order to get it initStreams to leave System.out and System.er alone.

    So, where are stdout and stderr?

    -J.C.

  • #2
    dm Server 2.0 Source Attachments in STS, and debugging into dm Server 2.0 code

    Post content removed and placed into a new thread.

    Comment


    • #3
      We capture them by default and log them using loggers named System.out and System.err. You can configure config/serviceability.xml to direct these to any appender(s) of your choice.

      That said, if you simply want to disable this capturing, you can do so by editing the config/com.springsource.osgi.medic.properties file and setting the sysOut and sysErr properties to false as desired.

      You question's actually very timely; earlier this week I added to above information to the documentation, although you'll need to download the latest nightly to see the updates until we release the next milestone / RC1.

      Comment


      • #4
        At last

        Hi, I'm using springsource-dm-server-2.0.1.RELEASE.

        In order to activate System.out messages in the console I had to add:

        Code:
                <logger level="INFO" additivity="false" name="System.out">
                        <appender-ref ref="EVENT_LOG_STDOUT" />
                </logger>
        to serviceability.xml. Yet it is confusing to me why there are also those props like log.wrapSysOut in com.springsource.osgi.medic.properties.

        Sadly in the web documentation, tutorials and books, it's assumed that the System.out messages will go to the console by default (and also, to the obsolete trace.log files.)

        Comment

        Working...
        X