[logback-dev] [JIRA] Created: (LBCLASSIC-227) HOSTNAME property not resolved

Simon Kelly (JIRA) noreply-jira at qos.ch
Wed Nov 3 11:30:51 CET 2010


HOSTNAME property not resolved
------------------------------

                 Key: LBCLASSIC-227
                 URL: http://jira.qos.ch/browse/LBCLASSIC-227
             Project: logback-classic
          Issue Type: Bug
    Affects Versions: 0.9.26
            Reporter: Simon Kelly
            Assignee: Logback dev list


When using the hostname property the following ERROR message is logged:

	Appender [EMAIL] of type [ch.qos.logback.classic.net.SMTPAppender] has no appplicable [HOSTNAME] property 

Configuration as below:
=======================================================
import ch.qos.logback.classic.encoder.PatternLayoutEncoder 
import ch.qos.logback.core.ConsoleAppender
import ch.qos.logback.classic.net.SMTPAppender
import ch.qos.logback.core.status.OnConsoleStatusListener
import ch.qos.logback.classic.PatternLayout
import ch.qos.logback.classic.html.HTMLLayout

import static ch.qos.logback.classic.Level.TRACE
import static ch.qos.logback.classic.Level.DEBUG
import static ch.qos.logback.classic.Level.INFO
import static ch.qos.logback.classic.Level.WARN
import static ch.qos.logback.classic.Level.ERROR

statusListener(OnConsoleStatusListener)

def appenderList = ["Console"]
def enable_email = true

if(enable_email) {
	appender("EMAIL", SMTPAppender) {
	  SMTPHost = "smtp.gmail.com"
	  SMTPPort = 587
	  STARTTLS = true	  
	  username = "username"
	  password = "password"
	  to = "to at demo.com"
	  from = "from at demo.com"
	  subject = "ERROR from ${HOSTNAME}: %logger{20} - %m"
	  layout(HTMLLayout) {
	   	pattern = "%d{HH:mm:ss.SSS}%thread%-5level%logger{36}%msg"
	  }
	}
	appenderList.add("EMAIL")
}

appender("Console", ConsoleAppender) {
  encoder(PatternLayoutEncoder) {
    pattern = "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
  }
}

logger("org.celllife", INFO)

scan("30 seconds")

root(ERROR, ["Console", "EMAIL"])

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list