On Tue, Nov 13, 2012 at 11:28 AM, Gary Gregory <garydgreg...@gmail.com>wrote:

> Here are some trunk/Beta3 examples:
>
>       <PatternLayout pattern="%highlight{%d{ISO8601} [%t] %-5level:
> %msg%n%throwable}{FATAL=white, ERROR=red, WARN=blue, INFO=black,
> DEBUG=green, TRACE=blue}" />
>       <PatternLayout pattern="%highlight{%d{ISO8601} [%t] %-5level:
> %msg%n%throwable}{style=Logback}" />
>       <PatternLayout pattern="%highlight{%d{ISO8601} [%t] %-5level:
> %msg%n%throwable}{style=Log4J}" />
>
> I wonder if we should also allow using color names in the % syntax, a la
> Logback:
>
>       <PatternLayout pattern="%red{this} %white{is} %blue{crazy}" />
>

This last one would be an alias for:

- "%style{this}{ANSI codes for red} %style{is}{ANSI codes for white}
%style{crazy}{ANSI codes for blue}"
- "%style{this}{red} %style{is}{white} %style{crazy}{blue}"

?

Gary


> ?
> Gary
>
>
> On Mon, Nov 12, 2012 at 5:57 AM, Olivier Lamy <ol...@apache.org> wrote:
>
>> Hi,
>> I try to customize that a bit using jansi to colorize the level.
>> My goal is to have a different color for each level.
>> So I try to do something like:
>> [%p{WARN=%style{WARNING}{orange}}]
>>
>> But the output is
>> [%style{WARNING}{orange}]
>>
>> Is there any way to do that ?
>> Thanks
>> --
>> Olivier
>>
>> 2012/10/31 Ralph Goers <rgo...@apache.org>:
>> > I could certainly document that as an option, but I only have one
>> opinion
>> > and a successful community needs more than that. If others want more
>> I18n
>> > support then we will add it.
>> >
>> > FWIW, with my suggestion a UI could treat the Level passed in the
>> LogEvent
>> > as the key into a resource bundle, so could easily be localized.  But
>> you
>> > are correct that if it is really desired to internationalize and
>> localize in
>> > the app then it is best that it be done in Log4j.
>> >
>> > Ralph
>> >
>> > On Oct 30, 2012, at 6:00 PM, Gary Gregory <garydgreg...@gmail.com>
>> wrote:
>> >
>> > OK, well, that a fine POV to have. It would be nice to document that.
>> >
>> > If we use the MVC metaphore, the log data (in a file for example) is the
>> > model.
>> >
>> > So let's say I do my own Logger wrapper that does l10n, I still get the
>> log
>> > levels in English.
>> >
>> > What I was referring to is to l10n Log4J2 itself, but apps would have
>> to do
>> > their own.
>> >
>> > That would address Olivier's wish.
>> >
>> > Gary
>> >
>> > On Tue, Oct 30, 2012 at 6:52 PM, Ralph Goers <
>> ralph.go...@dslextreme.com>
>> > wrote:
>> >>
>> >> This is actually a sore point with me.   It is my opinion that l10n
>> >> doesn't belong in the logging framework itself. That should be done in
>> the
>> >> UI where the user is viewing the messages. If you are going to do that
>> then
>> >> you should log a Message with a Message Id and the parameters and the
>> entire
>> >> LogEvent with the Message should be stored in the target repository.
>> >> Obviously a lot of people seem to disagree with me on this one.
>> >>
>> >> Ralph
>> >>
>> >>
>> >>
>> >> On Oct 30, 2012, at 2:44 PM, Gary Gregory wrote:
>> >>
>> >> This brings up the larger topic of i18n.
>> >>
>> >> Should we have a message properties file where folks can say
>> "Level.WARN =
>> >> WARNING"?
>> >> Eventually, if desired, other messages can be added.
>> >>
>> >> Gary
>> >>
>> >> On Tue, Oct 30, 2012 at 5:16 PM, Ralph Goers <
>> ralph.go...@dslextreme.com>
>> >> wrote:
>> >>>
>> >>> Ahh. Good question.
>> >>>
>> >>> I was looking at LevelPatternConverter. It would be relatively
>> trivial to
>> >>> allow it to accept options so that you could specify  %p{WARN=Warning,
>> >>> ERROR=Error,FATAL=Critical}
>> >>>
>> >>> Ralph
>> >>>
>> >>>
>> >>> On Oct 30, 2012, at 2:10 PM, Gary Gregory wrote:
>> >>>
>> >>> Do you want to use log4j 1.2.x or 2.0 (beta)?
>> >>>
>> >>> Gary
>> >>>
>> >>> On Tue, Oct 30, 2012 at 5:05 PM, Olivier Lamy <ol...@apache.org>
>> wrote:
>> >>>>
>> >>>> Hm, my goal is to use slf4j as api with log4j2.
>> >>>> I would prefer only provide a configuration file and to not have
>> >>>> specific log4j code introduced.
>> >>>>
>> >>>> 2012/10/30 Gary Gregory <garydgreg...@gmail.com>:
>> >>>> > Hm... in a custom layout I think...
>> >>>> >
>> >>>> > Gary
>> >>>> >
>> >>>> >
>> >>>> > On Tue, Oct 30, 2012 at 2:38 PM, Gary Gregory <
>> garydgreg...@gmail.com>
>> >>>> > wrote:
>> >>>> >>
>> >>>> >> In 1.2, maybe use reflection?
>> >>>> >>
>> >>>> >> In 2.0, I wonder if we should allow that to be changed and how. In
>> >>>> >> 2.0,
>> >>>> >> Level is an enum, not a class...
>> >>>> >>
>> >>>> >> Gary
>> >>>> >>
>> >>>> >>
>> >>>> >> On Tue, Oct 30, 2012 at 2:19 PM, Olivier Lamy <ol...@apache.org>
>> >>>> >> wrote:
>> >>>> >>>
>> >>>> >>> Hi,
>> >>>> >>> Is there any way to change the string use for level ?
>> >>>> >>> I'd like to use WARNING rather than WARN
>> >>>> >>>
>> >>>> >>> Thanks
>> >>>> >>> --
>> >>>> >>> Olivier Lamy
>> >>>> >>> Talend: http://coders.talend.com
>> >>>> >>> http://twitter.com/olamy | http://linkedin.com/in/olamy
>> >>>> >>>
>> >>>> >>>
>> >>>> >>>
>> ---------------------------------------------------------------------
>> >>>> >>> To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
>> >>>> >>> For additional commands, e-mail:
>> log4j-dev-h...@logging.apache.org
>> >>>> >>>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> --
>> >>>> >> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
>> >>>> >> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
>> >>>> >> Spring Batch in Action: http://bit.ly/bqpbCK
>> >>>> >> Blog: http://garygregory.wordpress.com
>> >>>> >> Home: http://garygregory.com/
>> >>>> >> Tweet! http://twitter.com/GaryGregory
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> > --
>> >>>> > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
>> >>>> > JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
>> >>>> > Spring Batch in Action: http://bit.ly/bqpbCK
>> >>>> > Blog: http://garygregory.wordpress.com
>> >>>> > Home: http://garygregory.com/
>> >>>> > Tweet! http://twitter.com/GaryGregory
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Olivier Lamy
>> >>>> Talend: http://coders.talend.com
>> >>>> http://twitter.com/olamy | http://linkedin.com/in/olamy
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
>> >>>> For additional commands, e-mail: log4j-dev-h...@logging.apache.org
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
>> >>> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
>> >>> Spring Batch in Action: http://bit.ly/bqpbCK
>> >>> Blog: http://garygregory.wordpress.com
>> >>> Home: http://garygregory.com/
>> >>> Tweet! http://twitter.com/GaryGregory
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
>> >> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
>> >> Spring Batch in Action: http://bit.ly/bqpbCK
>> >> Blog: http://garygregory.wordpress.com
>> >> Home: http://garygregory.com/
>> >> Tweet! http://twitter.com/GaryGregory
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
>> > JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
>> > Spring Batch in Action: http://bit.ly/bqpbCK
>> > Blog: http://garygregory.wordpress.com
>> > Home: http://garygregory.com/
>> > Tweet! http://twitter.com/GaryGregory
>>
>>
>>
>> --
>> Olivier Lamy
>> Talend: http://coders.talend.com
>> http://twitter.com/olamy | http://linkedin.com/in/olamy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-dev-h...@logging.apache.org
>>
>>
>
>
> --
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Reply via email to