System.out and System.err

Hi all,
This is a stupid newbie question, but I could not find the answer on the Web
site, so here goes: Where do System.out and System.err get written to? I'm
trying to deploy some plain-vanilla stateless session beans that do a bunch
of println() calls, but I can't see the output anywhere! The WebLogic
Console shows no messages, /myserver/weblogic.log has nothing interesting,
and there are no .log files anywhere that I can see. I even searched /tmp
and found nothing of interest. What am I missing? Do I have to explicitly
open a file for System.out and/or System.err? That doesn't sound right...
- danz

The simple answer to your questions are no and no.
I recently logged a problem with BEA WebLogic technical support regarding
this issue and their response is:
You have two choices. You can either use standard Java file i/o to write
your output to a file, or you can use our t3loggingservices to append
messages into the weblogic.log
The "jump point" for the logging services is at --
http://www.weblogic.com/docs51/classdocs/javadocs/weblogic/common/LogService
sDef.html
It is actually very easy to use -- after you import the proper packages into
your web application it is just as easy to use as System.out.println.
John J. Feigal Voice (651)766-8787 (main)
Sr. Technical Consultant (651)766-7249 (direct)
Ensodex, Inc. Fax (651)766-8792
4105 N. Lexington Ave., Suite 150 email [email protected]
Arden Hills, MN 55126 WebSite http://www.ensodex.com
"Jon Wynett" <[email protected]> wrote in message
news:[email protected]...
I'm running WebLogic as an NT Service. Is there any way to see the
System.out.println messages? Can they be redirected to the weblogic.log
file?
We were running through a DOS Window and saw all the messages, however we
ideally want to run Weblogic as a service.
"Rob Woollen" <[email protected]> wrote in message
news:[email protected]...
I'm guessing that you started the server with the .exe file on Windows.
If you're debugging with printlns, it's generally more conventient to
use the startWebLogic.sh or startWebLogic.cmd files to start the server
from a shell.
By default, you'll see stdout and stderr in the window.
-- Rob
Dan Zivkovic wrote:
Hi all,
This is a stupid newbie question, but I could not find the answer on
the
Web
site, so here goes: Where do System.out and System.err get written to?I'm
trying to deploy some plain-vanilla stateless session beans that do abunch
of println() calls, but I can't see the output anywhere! The WebLogic
Console shows no messages, /myserver/weblogic.log has nothinginteresting,
and there are no .log files anywhere that I can see. I even searched/tmp
and found nothing of interest. What am I missing? Do I have toexplicitly
open a file for System.out and/or System.err? That doesn't soundright...
- danz

Similar Messages

  • System.out and System.err  How to get to show up in log

    Does anyone know if there is anyway to get System.out and System.err
    messages to appear in the log?
    Trying to build and debug a JSP project is a complete nightmare when the
    remote developers cannot see System.out or System.err messages from helper
    classes.
    Platform= Windows NT 4.0
    Weblogic running as a Service
    Thanks in advance!

    Write a wrapper class to redirect the std out to what ever stream you want.
    HTH
    Saman

  • Temporarily routing System.out and System.err to a String

    Hi everybody,
    Does anyone know of a way to temporarily route System.out and System.err directly from the console into a String, then set it back to its default to the console? I know how to reroute to a text area:
    TextAreaOutputStream taos = new TextAreaOutputStream(yourTextArea);
    PrintStream ps = new PrintStream(taos);
    System.setErr(ps);
    System.setOut(ps);But it doesn't seem like there is either a way to reroute to a String or a way to switch back to the default routing afterward. Can anyone give me some advice on how to do this, please?
    Thanks,
    Jezzica85

    Too late to the party?
    import java.io.*;
    public class Redirection {
        public static void main(String[] args) {
            System.out.println("To console");
            PrintStream old = System.out;
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            PrintStream ps = new PrintStream(baos);
            System.setOut(ps);
            System.out.println("To memory");
            System.out.print("No 'ln'");
            //System.out.flush(); //needed?
            System.setOut(old);
            System.out.println("To console again?");
            System.out.println("earlier I wrote...");
            byte[] data = baos.toByteArray();
            String message = new String(data);
            System.out.println(message);
    }

  • Rerouting System.out and System.err

    Hi everybody,
    I'm trying to make a small application with an agnostic back end that can print out its progress messages to either the console or a JTextArea, depending on whether the console front end or GUI front end is called. I originally created a small utility class that the agnostic back end extended, in which one could set a variable which told it to use the JTextArea or console. The solution seems a bit clumsy to me, though, so it crossed my mind; does anyone know if there is a way, in the main method of a program, to reroute System.out and System.err to a desired location?
    Basically, I'd like functionality like this:
    Console front end:
    1. Start main
    2. Create object for back end
    3. All calls to System.out and System.err in back end route to console, as usual
    GUI front end:
    1. Start main
    2. Create Object for back end
    3. Create GUI
    4. Set System.out and System.err to show up in GUI text field
    5. All calls to System.out and System.err in back end route to text field in GUI
    Is this possible? I have my somewhat hacked solution working fine, but I don't want to start ripping it apart too badly until I know if something simpler like this can work. Can anyone point me in the right direction, please?
    Thanks,
    Jezzica85

    Thanks for the explanation scphan,
    In that case, I don't think that's exactly what I'm looking for.
    To answer both your question and cotton's:
    What I want to to is directly reroute System.out and System.err to a text area, only if I'm using a GUI. I'll try and explain it all, so if it gets long please bear with me--
    I have 3 classes, Calculate, Console, and GUI.
    Calculate is the back end of my application. Console is a front end class that allows the actions of Calculate to be run on the command line. GUI is a front end class that allows the actions of Calculate to be shown in a text area.
    I currently have a class, Output, that Calculate extends, and uses to print out progress/error messages. Output has a JTextArea data member, and print/println data members. If the JTextArea is null, calling the print methods prints to the console, and if not, the print methods print to the text area. So, at the current moment, I have a solution similar to that which scphan described (although I didn't recognize the terminology at first--apologies, it's almost 3 AM here).
    What I was wondering is if there is a simpler, more elegant way to do this. I have a few different small applications that have a similar setup to this one, and all the background classes must extend the Output class to work. If creating a class that every back end class must extend is the best way to do this, then I won't mess with what I have, but if there is a more elegant solution I've overlooked, I'd like to use that instead.
    I hope that's clear, sorry if there was any confusion.
    Thanks,
    Jezzica85

  • Replace System.out and System.err

    Hi there,
    i got an Applet/Application Hybrid and i want to replace the System.out and System.err - Stream with my personal Streams.
    When started as an Application it shell be given out to a file and when started as an Applet it shell be given out to the current HTML-Document...
    But how do i realize that with the Applet. The thing with the Application and the file works fine, so don�t worry about that..
    so in short my question is:
    how can i replace/modify the System.out and System.err Streams in a way so that the output will be given the current HTML-Document when started as an Applet?
    thx anyway
    cu Errraddicator

    i know this method, but i don�t know how to make a PrintStream that gives the input to the HTML-Document...
    excuse me if my kind of expressions were not so excactly...
    thx anyway
    cu Errraddicator

  • OPMN system.out and system.err log rotation?

    I would like to rotate the log generated by OPMN by default for system.out & system.err, which is named:
    OC4J~APPNAME~home~default_island~1
    I see the entries in the opmn.xml file for the ons.log and ipm.log which ARE being rotated properly. I've read that you can redefine the log file for system.out and system.err, but can't find any about rotating these logs.
    Does anyone have any info about this topic?

    If anyone's curious and is trying to do this themselves, I eventually asked Oracle, who stated it could not be done.

  • Is it possible to redirect System.out and System.in for a thread

    I would like to run two threads. One should keep writing to System.out and System.in. The other thread output written to System.out and System.in shoudl be captured and written to a file. Is this possible? I don't think so, but perhaps someone know some workaround.
    rasped

    hmmm sure it's possible. You can write an outputstream that does different things depending on which thread is running, and then set system.out to a printstream that writes to that outputstream.

  • Redirecting System.out and System.err to files

    Is there a way I can configure my web-appliction (in web.xml or something) to redirect all the output (.err and .out) to specific files?

    I think you could create PrinStreamS from your desired output files and then use System.setOut(<...>) and System.setErr(<...>). Place this code in a servlet that you load at startup...

  • System.out and System.err to files

    Hi !
    Could somebody tell me, how I can forward all System.out.println and System.err.println Messages from
    my Java modules (EJB, Servlets) to different files respectively.
    Thanks
    Steve

    I think you could create PrinStreamS from your desired output files and then use System.setOut(<...>) and System.setErr(<...>). Place this code in a servlet that you load at startup...

  • System.out vs System.err questions

    Hello,
    System.out and System.err both seem to direct regular and error output to the stdout. I have the following questions:
    1. I used System.setOut() to direct regular output to "Output.txt" and System.setErr() to direct errors to "Errors.txt". I purposely made the program to throw some exceptions, wanting to redirect them to "Errors.txt". It did not work. My question is "What kind of errors setErr() would direct to an error file?"
    2. Without using setErr(), errors go to stdout. My question is "Does Java hava a configuration file I can configue to direct regular output to stdout, but errors to a user-defined file such as errors.log?"
    Thanks!

    I see the stack trace in file err.txt:
    import java.io.*;
    public class Example {
        public static void main(String[] args) throws FileNotFoundException {
            System.setOut(new PrintStream(new FileOutputStream("out.txt"), true));
            System.setErr(new PrintStream(new FileOutputStream("err.txt"), true));
            System.out.println("<stdout>");
            System.err.println("<stderr>");
            throw new RuntimeException("here we go");
    }

  • System.our and System.err

    Hi,
    Is there a buffer size for system.out and System.err.
    If so how can we retrieve the buffer size.
    Thanking You,
    Chamal.

    There is no way to determine the characteristics of the OutputStream behind System.out or System.err.
    You could provide your own streams (via setOut() and/or setErr() methods)...
    Why do you need to know?

  • No System.out or System.err when Debugging in workshop

    I'm running workshop 8.1.3. When I debug my application I can see it process several lines with System.out and System.err. However I can not find the ouput anywhere. I've checked the Build window, output window among others but cannot find any of the output. What am I doing wrong ?

    Probably the output is going to the WebLogic window. On Windows, it would be the command prompt window where the server instance is launched.
    I'm running workshop 8.1.3. When I debug my
    application I can see it process several lines with
    System.out and System.err. However I can not find the
    ouput anywhere. I've checked the Build window, output
    window among others but cannot find any of the
    output. What am I doing wrong ?

  • System.setOut() and System.setErr()

    Hi
    In my application, I capture all of the println()s to System.out and System.err so that I can display them in a TextArea using a Thread as such:
    final PipedInputStream stdoutStream = new PipedInputStream();
    PrintStream stdout = new PrintStream(new PipedOutputStream(stdoutStream));
    System.setOut(stdout);
    final PipedInputStream stderrStream = new PipedInputStream();
    PrintStream stderr = new PrintStream(new PipedOutputStream(stderrStream));
    System.setErr(stderr);
    // start listening to stdout stream
    new Thread()
      public void run()
        try             
          BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(stdoutStream));
          String line = "";
          while (line != null)
            line = stdoutReader.readLine();
            messageArea_.append(line + "\n"); // <----- TextArea
        catch (Throwable t)
          t.printStackTrace();
    }.start();
    // ...and same for stderr...
    stdout.close();
    stderr.close();
    // revert System.out and System.err back to default streams
    System.setOut(System.out);    <--------- !!!
    System.setErr(System.err);    <--------- !!! The last two line don't behave as I expect, and all output continues to go the the TextArea instead of to System.out and System.err.
    Can someone please explain what I've done wrong and how I can go about reverting System.out and System.err?
    Thanks in advance
    Delfina

    While the second option may be better in terms of code
    style, the first option is still valid and shouldn't
    pose problems (the only difference is he writes a
    carriage return on the first line regardless). Maybe
    I'm missing something ashutosh?Hi schillj, here's the thing, the check for line != null is done before the "first" readLine() is called. So if the first readLine returns a null, it would still send it to the text area. In the my sugested code the first call's results are checked as well.
    while (line != null)  {       
    line = stdoutReader.readLine();        messageArea_.append(line + "\n"); // <--TextArea     

  • Intercepting System.exit() and System.out.println() calls

    hi there,
    I have often problems when working with code that uses System.exit() and System.out.println() extensively, because it becomes difficult to debug.
    Basically I do have wrappers for System.exit() (my own static exit function) and for System.out.println() (log4j).
    Still not all programmers are using these methods; Probably the only way to enforce this is some kind of code warrior, but I was hoping to be able to intercept the two System.XXX calls (and throw an appropriate Exception). is this possible ??

    Why not simply make your own security manager andhandle checkExit() and checkWrite?
    Does anyone have a simple example of this? Please?System.exit() can be intercepted using a security manager, but not System.out.xxx.
    Here is a short example:
    //set your security manager
    static{
         SecurityManager s = new OwnSecurityManager();
         System.setSecurityManager(s);
    //redirect the out stream
    try{
         PrintStream ps = new PrintStream(new FileOutputStream("output.txt"));
         System.setOut(ps);
    }catch(IOException ioe){
         ioe.printStackTrace();
    //some tests
    System.out.println("Test");
    System.exit(2);
    //your security manager
    class OwnSecurityManager extends SecurityManager{
         public void checkExit(int code){
           if(code > 0){
             super.checkExit(code);
             throw new SecurityException("Not allowed here->" + code);
         public void checkRead(FileDescriptor fd){
         public void checkRead(String file){
         public void checkRead(String file, Object context){
         public void checkPermission(Permission perm){
           if(perm.getName().equals("exitVM")){
             System.out.println("exitVM");
    }

  • System Landscape and system alias

    Dear All EP Expert,
    I have some general questions.
    1) If i wanted to connect my EP 7.0 to backend ECC 6. Is there any specific name that i must use for my system landscape and system alias?
    2) Is the system lanscape come in when i include the business package?
    3) Where can i download the latest ESS and MSS business package?
    Can someone assist me on this?
    Thanks you in advance...
    Regards,
    Bryan

    Hi Brian ,
    you cal also download latest ESS and MSS business packages from -->
    download the business package from service market place.
    Navigate through Downloads --> SAP Support Package --> Entry by Application group --> SAP Application Components --> SAP ERP --> SAP ERP2005 -->Entry Point by component -->SAP XSS Self - Service --> SAP ESS 600.
    and similar for MSS 600 business package.
    You cal also refer to this Note for further details about Self Services Business Packages.
    [Note 1004528|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1004528]
    Hope this helps.
    And Regarding System Alias names, there is no such specific name you should keep, as no standard name exists , read more about it on.
    [system aliases|http://help.sap.com/saphelp_nw70/helpdata/en/e9/9bc93f92908032e10000000a11405a/frameset.htm]
    Also,
    System Aliases and SAP Systems
    For SAP systems (BW, CRM, and so on), it is recommended to use a system alias that has as its name parameter the logical system name as defined in the SAP system itself. The logical system is specified in Table T000 in the SAP system.
    Reward points if helpful
    Regards,
    Shailesh Nagar
    Edited by: Shailesh Kumar Nagar on Jan 18, 2008 11:29 AM
    Edited by: Shailesh Kumar Nagar on Jan 18, 2008 11:37 AM

Maybe you are looking for

  • HT204384 why can't I transfer an Album to a blank SD card?

    Can i transfer an Album in iPhoto to a blank SD card. if so how? Dragging from iPhoto to the Sd icon on the desktop does not work.

  • I want to set text label and set filter value as header  in query

    i want to set any text label or i want to design query in such manner that whatever the value is selected by client in selection screen  is become heading in query . like if i select posting date then that range should be displayed in heading portion

  • Forms Personalization: Ensure they take effect?

    I have been tinkering with Forms Personalization in an 11i10 installation and have found some inconsistencies regarding when the actual personalizations take effect. Is there a known 'formula' to ensure that all forms Personalizations take effect? Le

  • Populate the find field in LOV programmatically

    I am using Show_lov under a specific condition for the user. The user would have entered a part of text in the text box before itself. So I would want to populate this text in the Find box of LOV so that the LOV navigates to that level. Any help???

  • Mpeg Streamclip error msg. 'movie's too long'

    I am trying to convert an mp4 from Vimeo, to a Quicktime file.  When i put it into streamclip, and try to export only 3 min. of the 20 min. movie, I get an error msg. stating that the movie is 'too long'... It's only 20 min., and only need 3 min., so