Java.Util.Logging Color Output in IDE

Discussion in 'Java' started by Symz, Mar 23, 2005.

  1. Symz

    Symz Guest

    Hi comp.java

    Can someone please explain the different colors I see in my Eclipse console
    when I use java.util.logging. Also, how does one configure this? I seem to
    recall this happening in JDeveloper as well so I assume this is a logging
    feature and would like to use it properly.

    I have a straight forward property file in both a Tomcat and normal console
    based app. The color for the Tomcat app output is blue regardless of level
    and red for the console app (regardles of level).

    I can't seem to google effectlively to get the answer.

    Apologies if this is the wrong newsgroup.
    Symz, Mar 23, 2005
    #1
    1. Advertising

  2. Symz

    Roland Guest

    On 23-3-2005 17:57, Symz wrote:
    > Hi comp.java
    >
    > Can someone please explain the different colors I see in my Eclipse console
    > when I use java.util.logging. Also, how does one configure this? I seem to
    > recall this happening in JDeveloper as well so I assume this is a logging
    > feature and would like to use it properly.
    >
    > I have a straight forward property file in both a Tomcat and normal console
    > based app. The color for the Tomcat app output is blue regardless of level
    > and red for the console app (regardles of level).
    >
    > I can't seem to google effectlively to get the answer.
    >
    > Apologies if this is the wrong newsgroup.
    >
    >


    The Eclipse output console renders output to System.out in blue, and
    output to System.err in red. Keyboard input for System.in is rendered in
    green. It further somehow parses the output to make class references in
    a stack trace act as a hyperlink (so a click shows the source at the
    proper line number).

    IIRC, the default console handler of java.util.logging prints messages
    to System.err, and therefor Eclipse renders them red. Maybe Tomcat logs
    its messages to System.out (rendered blue).
    --
    Regards,

    Roland de Ruiter
    ___ ___
    /__/ w_/ /__/
    / \ /_/ / \
    Roland, Mar 23, 2005
    #2
    1. Advertising

  3. Symz

    Symz Guest

    Aha.

    " IIRC, the default console handler of java.util.logging prints messages
    to System.err, and therefor Eclipse renders them red. Maybe Tomcat logs
    its messages to System.out (rendered blue)."

    That rings a bell. Out of interest, do you know how to go to redirect
    System.err to System.out for java.util.logging?

    Thanks Roland,

    Cheers Simon.
    Symz, Mar 23, 2005
    #3
  4. Symz

    Roland Guest

    On 23-3-2005 18:23, Roland wrote:

    > On 23-3-2005 17:57, Symz wrote:
    >
    >> Hi comp.java
    >>
    >> Can someone please explain the different colors I see in my Eclipse
    >> console
    >> when I use java.util.logging. Also, how does one configure this? I
    >> seem to
    >> recall this happening in JDeveloper as well so I assume this is a logging
    >> feature and would like to use it properly.
    >>
    >> I have a straight forward property file in both a Tomcat and normal
    >> console
    >> based app. The color for the Tomcat app output is blue regardless of
    >> level
    >> and red for the console app (regardles of level).
    >>
    >> I can't seem to google effectlively to get the answer.
    >>
    >> Apologies if this is the wrong newsgroup.
    >>
    >>

    >
    > The Eclipse output console renders output to System.out in blue, and
    > output to System.err in red. Keyboard input for System.in is rendered in
    > green. It further somehow parses the output to make class references in
    > a stack trace act as a hyperlink (so a click shows the source at the
    > proper line number).
    >
    > IIRC, the default console handler of java.util.logging prints messages
    > to System.err, and therefor Eclipse renders them red. Maybe Tomcat logs
    > its messages to System.out (rendered blue).


    Another addition: the colors are IDE specific. In Eclipse 3.0 they can
    be configured in Window -> Preferences -> Run/Debug -> Console.


    --
    Regards,

    Roland de Ruiter
    , ___ ___
    /__/ w_/ /__/
    / \ /_/ / \
    Roland, Mar 23, 2005
    #4
  5. Symz

    Symz Guest

    > That rings a bell. Out of interest, do you know how to go to redirect
    > System.err to System.out for java.util.logging?


    Only seems possible if you subclass the consolehandler and set the stream
    via the protected setOutputStream method, like

    class myConsoleHandler extends ConsoleHandler {
    public myConsoleHandler() {
    super();
    this.setOutputStream(System.out);
    }
    }

    Any other suggestions?
    Symz, Mar 23, 2005
    #5
  6. Symz

    Guest

    not to be the smartass, but just use log4j and define the appenders as
    you like them
    , Mar 24, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Siegl
    Replies:
    0
    Views:
    949
    Stefan Siegl
    Aug 27, 2003
  2. Michael T. Peterson
    Replies:
    2
    Views:
    731
    Michael T. Peterson
    Sep 9, 2003
  3. janne
    Replies:
    0
    Views:
    9,471
    janne
    Sep 10, 2004
  4. Java script Dude

    java.util.logging for Java 1.3.1

    Java script Dude, Oct 27, 2005, in forum: Java
    Replies:
    2
    Views:
    664
    Tor Iver Wilhelmsen
    Oct 28, 2005
  5. Royan
    Replies:
    1
    Views:
    1,432
    Andrea Francia
    Apr 1, 2008
Loading...

Share This Page