That's a good point.

Well... In between responses, I was excited to stumble upon a possible
silver bullet. There is a "disableAnsi" attribute on the pattern layout
[1]. Trying it on my file appenders, I can say most of my log files are now
without ANSI escape codes. That's good!

However, I still got a few. It's an oddity and possible edge case. If the
message (%m) includes ANSI escape codes, those are passed right through. So
I guess "disableAnsi" is only a filter for the layout "pattern" and not the
message itself?

And what do you guys think of this behavior?

[1]
https://logging.apache.org/log4j/log4j-2.4/manual/layouts.html#PatternLayout

Cheers and God bless,
Paul


On Mon, Jun 10, 2019 at 3:59 PM Gary Gregory <garydgreg...@gmail.com> wrote:

> On Mon, Jun 10, 2019 at 4:55 PM Paul Benedict <pbened...@apache.org>
> wrote:
>
> > Pattern converters don't have the intelligence. I agree. However,
> > converters don't exist for their own sake -- they exist for layouts and
> > ultimately for Appenders. Those are the instances that have the
> > intelligence to make sense out of themselves. Even more so is the
> Processor
> > to make sense out of the configuration file.
> >
> > Hence my original question:
> >
> > Does it make sense for a File Appender to emit "colors"?
> >
>
> It does if you want to later output the file to a console.
>
> Gary
>
>
> >
> > If it does, then okay, but I'd like to hear the concrete justification
> one
> > way or another. I am interested in the purpose.
> >
> > Cheers and God bless,
> > Paul
> >
>

Reply via email to