i think hit playframework - logback specific bug, perhaps not, assistance great!
i' ve needed email appender send me emails when error occures.
created simple 1 properties defined within:
<appender name="email" class="ch.qos.logback.classic.net.smtpappender"> <smtphost>myhost</smtphost> <smtpport>25</smtpport> <starttls>true</starttls> <username>username</username> <password>pass</password> <to>to</to> <from>from</from> <subject>error: %logger{20} - %m</subject> <layout class="ch.qos.logback.classic.patternlayout"> <pattern>%date %-5level %logger{35} - %message%n</pattern> </layout> </appender> this worked fine.
wanted refactor of properties cause don't want commit passwords , stuff source control.
replaced properties ${propname} , added @ begining
<property file="conf/mail.properties"/> now emails not sent anymore.
debugged , printed out properties , saw problem has quotes.
to/from email addresses, when put them in properties file need surround them quotes otherwise error this:
caused by: com.typesafe.config.configexception$parse: /myconfdir../mail.properties: 19: reserved character '@' not allowed outside quotes also password has "+" symbol in , if it's unquoted in properties file same error.
when debugging these quoted values see quote included inside them.
email trying sent "a@b.com" , no a@b.com. same field , password.
doesn't work.
any idea how prevent this?
i have done same task :
in logback.xml file, add :
property resource="filename.properties" <username>${username}</username> <password>${password}</password> <to>${email1}</to> <from>${from}</from>
Comments
Post a Comment