logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: SMTPAppender reads properties SMTPTransport ignores(?) them
Date Wed, 05 Sep 2007 18:01:55 GMT

On Sep 5, 2007, at 12:14 PM, Xh wrote:

> Hi All!
>
> I've downloaded the newest 1.2.15.
>
> I still cannot send e-mail reports but at least I have SMTPDebug  
> working properly.
>
> As before my log4j.xml is:
>
> <appender name="email" class="org.apache.log4j.net.SMTPAppender">
>         <param name="BufferSize" value="512" />
>         <param name="SMTPHost" value="host" />
>         <param name="SMTPUsername" value="user" />
>         <param name="SMTPPassword" value="paswd" />
>         <param name="SMTPDebug" value="true" />
>         <param name="From" value="from" />
>         <param name="To" value="to" />
>         <param name="Subject"
>             value="[SMTPAppender] Application message" />
>         <layout class="org.apache.log4j.PatternLayout">
>             <param name="ConversionPattern"
>                 value="[%d{ISO8601}]%n%n%-5p%n%n%l%n%n%m%n%n" />
>         </layout>
>         <filter class="org.apache.log4j.varia.LevelRangeFilter">
>             <param name="LevelMin" value="ERROR" />
>             <param name="LevelMax" value="FATAL" />
>         </filter>
> </appender>
>
> But it looks like SMTP* properties don't work, take a look at this  
> (Debug output):
>
> SMTPTransport DEBUG: Connecting to server null:-1 for user xh
> SMTPTransport DEBUG: Connecting to server null:-1 for user user
> SMTPTransport DEBUG: Attempting plain socket connection to server  
> null:25
> SMTPTransport DEBUG: Received exception -> I/O exception  
> establishing connectionSMTPTransport DEBUG: Exception message ->  
> Connection refused
>
> WOW,
>
> first line: server is NULL, port is -1 (??), xh user is my Linux user
> second line: server is still NULL, port is -1 (??),  but  'user' is  
> what I defined in SMTPUsername
> third line: plain connection to null:25 -?
>
> any ideas?
> best regards
> Ɓukasz
>

The "server null" in the debug output looks to me like whatever value  
you really specified for SMTPHost isn't a resolvable server name.  If  
you actually had "host" in there, I assume that it would fail unless  
you really had a reachable machine named host.  The values in the  
configuration file are string literals, they are not the value of  
system properties.  So if you intended that "host", "user" or  
"passwd" would be replaced by the content of the system properties,  
you need to use "${host}", etc.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message