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

Thomas Golden edited comment on LOG4J2-236 at 5/2/13 8:52 PM:
--------------------------------------------------------------

Looking through the source, I see that the variable _ought_ to be substituted, 
but that the result of lookups.get("env") on line 101 in Interpolator returns 
null. It seems that the other resolvers have not been registered at this point. 
From looking at BaseConfiguration and Interpolator I would be led to the 
conclusion that appenders are expected to do property substitution of 
environment variables at runtime and that this is a failing of SMTPAppender 
rather than the configuration process itself.
                
      was (Author: tomrk1089):
    Looking through the source, I see that the variable _ought_ to be 
substituted, but that the result of lookups.get("env") on line 101 in 
Interpolator returns null. It seems that the other resolvers have not been 
registered at this point.
                  
> SMTPAppender does not interpolate variables
> -------------------------------------------
>
>                 Key: LOG4J2-236
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-236
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-beta5
>         Environment: OS X 10.7 Lion (11.4.2 Darwin Kernel Version 11.4.2: Thu 
> Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64)
>            Reporter: Thomas Golden
>
> When configuring an SMTP appender as follows, I would expect the smtpHost 
> property to be interpolated, and the appropriate environment variable 
> substituted:
> <SMTP name="Mailer" subject="Error" to="[email protected]" 
> from="[email protected]"
>             smtpHost="${env:SMTP_HOST}" smtpPort="25" bufferSize="1"></SMTP>
> Instead, Log4J complains that the host ${env:SMTP_HOST} is unknown.
> The documentation does not state that these variables cannot be interpolated, 
> so from reading the manual I would assume this is a bug and not, in fact, by 
> design.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to