Hi, Douglas, Jason,

Jason - thanks for your feedback!  I'll definitely incorporate some of
that, especially around what's appropriate for each level.

Douglas - it's not as bad as writing my own layout, but it will make
some people uncomfortable!  Here's the trick for changing the level
strings:


The "levelStr" member on Level has default ("package") access, and
it's writable.  So in my webapp or jar file I usually create one new
class in the "org.apache.log4j" package that looks like this:


package org.apache.log4j;
public class LevelChanger {
    public static void changeLevels() {
        Level.DEBUG.levelStr = "_";
        Level.INFO.levelStr = " ";
        Level.WARN.levelStr = "!";
        Level.ERROR.levelStr = "*";
        Level.FATAL.levelStr = "***";
    }
}


Even though LevelChanger is code I write and package in a separate jar
file, as long as I declare it part of the "org.apache.log4j", it can
change the level strings.


yours,

Julius


On Fri, Jun 6, 2008 at 5:43 AM,  <[EMAIL PROTECTED]> wrote:
> interesting reading... going to share some of this with my coworkers, even
> though we generally don't use log4j....
>
> thanks for sharing it.
>
> the last sentence piqued my interest:
>
> I find ! * + and [space] more convenient to work with than the verbose
> "INFO, DEBUG, ERROR, WARN".
>
> Is there a way to get the custom level indicators  (besides writing your
> own layout?)?
>
> Douglas E Wegscheid
> Lead Technical Analyst, Whirlpool Corporation
> (269)-923-5278
>
> "A wrong note played hesitatingly is a wrong note. A wrong note played
> with conviction is interpretation."
>
>
>

-- 
yours,

Julius Davies
250-592-2284 (Home)
250-893-4579 (Mobile)
http://juliusdavies.ca/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to