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.

1 Answer 1

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
[email protected]
log4j.appender.email.SMTPPassword=mypw
[email protected]
log4j.appender.email.BufferSize=1
log4j.appender.email.EvaluatorClass=TriggerLogEvent
log4j.appender.email.layout=org.apache.log4j.PatternLayout
log4j.appender.email.layout.ConversionPattern=%m

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.