logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <boa...@gmail.com>
Subject Re: Appenders
Date Thu, 28 Aug 2014 01:43:05 GMT
Are you programmatically adding the Appender?

I suggest the reconfiguration method because it allows for gracefully
switching to a new configuration. Some appenders need fields to remain
immutable for performance or safety reasons, so creating a new Appender on
reconfigure is generally the safer option.


On 26 August 2014 02:43, Clément Guillaume <cguillaume@hotpads.com> wrote:

> Yes, I know that.
> So if I have 10 LoggerConfigs that use the same Appender and I want to
> change a property of this Appender, I should create a new one and update
> the appender list (remove the old one and add the new one) of my 10
> LoggerConfigs?
> There isn't a simpler way, is there?
>
> Clément
>
>
> On Mon, Aug 25, 2014 at 8:58 PM, Matt Sicker <boards@gmail.com> wrote:
>
> > If you reconfigure Log4j at runtime, you can switch over to a new
> > LoggerConfig without losing any messages. If you're holding direct
> > references to LoggerConfig, you should probably step back a level and get
> > that on demand instead.
> >
> >
> > On 25 August 2014 14:22, Clément Guillaume <cguillaume@hotpads.com>
> wrote:
> >
> > > Hi,
> > >
> > > I would love to have a direct access to the target of a ConsoleAppender
> > (as
> > > I can directly get the fileName of a FileAppender). Do you plan to
> > > implement this feature ? (and also for others properties like
> > > ConsoleAppender.isFollow or FileAppender.immediateFlush, ...)
> > >
> > >
> > > I also would love to be able to dynamically update thess properties. I
> > > don't think it is currently possible.
> > > Or at least I would like to be able to replace an Appender in the
> > > Configuration (by a new one) without removing the Appender from all the
> > > previously associated LoggerConfig.
> > >
> > > Regards,
> > >
> > > Clément
> > >
> >
> >
> >
> > --
> > Matt Sicker <boards@gmail.com>
> >
>



-- 
Matt Sicker <boards@gmail.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message