Log4j: Configuring SMTPAppender

Hi all,

I'd like to configure a smtpappender in logging.yml so that an email is
sent whenever a message is logged.

Unfortunately, the yml configuration isn't very well documented on log4j
homepage and I wasn't able to find any working example in the www.

I also tried to put a separate logging.properties in $ES_HOME$/config, but
didn't get it working.

My last try (not working - no email is being sent):
es.logger.level: INFO
rootLogger: ${es.logger.level}, console, file, email
logger:
...

appender:
console:
....
email:
type: smtp
smtpHost: my.smtp.host
from: es@example.net
to: admin@example.net
subject: ElasticSearch Warning
layout:
type: pattern
conversionPattern: .....

So, does anybody have a working example to do so?

Regards,

Abid

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/58c92f42-0046-453e-add0-3b726cafa822%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Just for evaluation purposes, I tried to configure a simple
logging.properties in $ES_HOME/config but not even this had any success.

log4j.rootLogger=DEBUG, A1

log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.File=/home/my_user/elasticsearch.log
log4j.appender.A1.MaxFileSize=40000KB
log4j.appender.A1.MaxBackupIndex=5
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=[%d{ISO8601}][%-5p][%-25c] %m%n
log4j.appender.A1.Encoding=UTF-8

No file /home/my_user/elasticsearch.log is being created when starting
elasticsearch (directory /home/my_user exists) and I have no idea what I'm
doing wrong... :frowning:

Regards,

Abid

Am Montag, 9. Februar 2015 15:31:01 UTC+1 schrieb Abid Hussain:

Hi all,

I'd like to configure a smtpappender in logging.yml so that an email is
sent whenever a message is logged.

Unfortunately, the yml configuration isn't very well documented on log4j
homepage and I wasn't able to find any working example in the www.

I also tried to put a separate logging.properties in $ES_HOME$/config, but
didn't get it working.

My last try (not working - no email is being sent):
es.logger.level: INFO
rootLogger: ${es.logger.level}, console, file, email
logger:
...

appender:
console:
....
email:
type: smtp
smtpHost: my.smtp.host
from: es@example.net
to: admin@example.net
subject: Elasticsearch Warning
layout:
type: pattern
conversionPattern: .....

So, does anybody have a working example to do so?

Regards,

Abid

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d50ebd43-6c92-473c-b5f2-491623b4b093%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.