0

Is there a way to set up Alfresco to send email to admins on each server error as in Python Django Error reporting via e-mail?

Thanks in advance for any hint.

slaweet
  • 385
  • 2
  • 17

1 Answers1

3

The first thing I would say is that you need to really look in to the viability of using e-mails to help admins spot problems with servers. Sending an e-mail can be a heavy operation and as such, particularly with many repeated errors, can make an existing problem worse. And what about the cases where the ability to send e-mails goes down or a problem so severe happens that it simply cannot send e-mails?

For properly setting up reporting on your servers you might want to look at Logstash + Kibana: http://alfresco.blog.redpill-linpro.com/2014/07/01/alfresco-logging-with-logstash-and-kibana-part-1-the-basics/

That being said, it should be possible to configure log4j to use an SMTP appender if that is the route you want to go down: What is the proper way to configure SMTPAppender in log4j?

In Alfresco 4.2 you should need to add something such as the following to the log4j.properties in tomcat/webapps/alfresco/WEB_INF/classes/:

#CONFIGURE SMTP
log4j.appender.email=org.apache.log4j.net.SMTPAppender
log4j.appender.email.SMTPHost=mail.mydomain.com
log4j.appender.email.SMTPUsername=myuser@mydomain.com
log4j.appender.email.SMTPPassword=mypw
log4j.appender.email.From=myuser@mydomain.com
log4j.appender.email.BufferSize=1
log4j.appender.email.EvaluatorClass=TriggerLogEvent
log4j.appender.email.layout=org.apache.log4j.PatternLayout
log4j.appender.email.layout.ConversionPattern=%m
Community
  • 1
  • 1
Mardoz
  • 1,617
  • 1
  • 13
  • 26