You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Benjamin Jaton (JIRA)" <ji...@apache.org> on 2016/07/05 17:27:11 UTC

[jira] [Commented] (LOG4J2-1450) SMTPAppender support for runtime lookup

    [ https://issues.apache.org/jira/browse/LOG4J2-1450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15362818#comment-15362818 ] 

Benjamin Jaton commented on LOG4J2-1450:
----------------------------------------

Reloading the configuration seems fine to me. I use a custom StrLookup to resolve my SMTP settings so I really only have to reload the same conf again to trigger the re-creation of that javax.mail.Session object.

What's the preferred way to programatically trigger a reload of the configuration?

Should I open a separate bug for the email subject?

> SMTPAppender support for runtime lookup
> ---------------------------------------
>
>                 Key: LOG4J2-1450
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1450
>             Project: Log4j 2
>          Issue Type: Improvement
>            Reporter: Benjamin Jaton
>
> http://logging.apache.org/log4j/2.x/manual/configuration.html#RuntimeLookup
> "Not all elements support resolving variables at runtime."
> The SMTPAppender doesn't support using:
> {noformat}{
>         "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}"
> }{noformat}
> However that would be very useful so that the user doesn't have to reload the whole log4j2 configuration when the SMTP parameters have changed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org