logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Jaton <benjamin.ja...@gmail.com>
Subject Re: Reloading appender after property value changes
Date Mon, 27 Jun 2016 18:30:29 GMT
I am using a custom LookUp class that implements StrLookup:

{
  "configuration" : {
    "packages" : "my.custom.logging.plugins",

So the monitoringInterval won't detect any change of property that's fed in
there.

I wonder if it's possible to reload just an appender and not the whole
configuration?

On Mon, Jun 27, 2016 at 11:23 AM, Matt Sicker <boards@gmail.com> wrote:

> I know one simple way would be to use the monitorInterval attribute on
> Configuration and then touching the file to change its last modified time.
> There might be a better solution, though. You can programmatically cause a
> reconfiguration as well.
>
> On 27 June 2016 at 13:17, Benjamin Jaton <benjamin.jaton@gmail.com> wrote:
>
> > Hello,
> >
> > I have a simple appender like:
> >
> > {
> >         "type" : "smtp",
> >         "name" : "EmailAppender",
> >         "subject" : "${email.subject}",
> >         "to" : "${email.recipient}",
> >         "from" : "${email.from}",
> >         "smtpProtocol" : "${email.smtp.protocol}",
> >         "smtpHost" : "${email.smtp.host}",
> >         "smtpPort" : "${email.smtp.port}",
> >         "smtpUsername" : "${email.smtp.username}",
> >         "smtpPassword" : "${email.smtp.password}"
> > }
> >
> > When I have a updated value for one of those property (for example
> > ${email.subject} has changed, what's the simplest way to reload the
> > appender so that it takes that new value?
> > Do we have to force a full reconfiguration?
> >
> > Thanks
> > Ben
> >
>
>
>
> --
> Matt Sicker <boards@gmail.com>
>

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