Table of Contents

Back to Table of Contents

NAME

Log::Log4perl::Appender::AmazonSES - Send via Amazon SES (SMTP over TLS)

Back to Table of Contents

SYNOPSIS

 use Log::Log4perl::Appender::AmazonSES;

 my $app = Log::Log4perl::Appender::AmazonSES->new(
   Host    => 'email-smtp.us-east-1.amazonaws.com',
   Port    => '465'
   Hello   => 'localhost.localdomain',
   Timeout => 2,
   Debug   => 0,
   from    => 'me@example.com',
   to      => 'you@example.com',
   subject => 'Alert: there has been an error',
 );

 $app->log(message => "A message via Amazon SES email");

Back to Table of Contents

DESCRIPTION

This appender uses the Net::SMTP module to send mail via Amazon SES. Essentially a flavor of Log::Log4perl::Appender::Net::SMTP with some intelligent options and restrictions.

This module was created to provide a straightforward, well-documented method for sending Log4perl alerts via Amazon SES. While other email appenders exist, getting them to work with modern, authenticated SMTP services can be challenging due to outdated dependencies or sparse documentation. This appender aims to "just work" by using Net::SMTP directly with the necessary options for SES.

Back to Table of Contents

OPTIONS

Back to Table of Contents

EXAMPLE LOG4PERL CONFIGURATION

Use Environment Variables (Best Practice)

log4perl.rootLogger = INFO, Mailer
log4perl.appender.Mailer = Log::Log4perl::Appender::AmazonSES
log4perl.appender.Mailer.from       = ...
log4perl.appender.Mailer.to         = ...
log4perl.appender.Mailer.subject    = ...
log4perl.appender.Mailer.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.Mailer.layout.ConversionPattern = %d - %p > %m%n

Specify Credentials

log4perl.rootLogger = INFO, Mailer
log4perl.appender.Mailer = Log::Log4perl::Appender::AmazonSES
log4perl.appender.Mailer.from       = ...
log4perl.appender.Mailer.to         = ...
log4perl.appender.Mailer.subject    = ...
log4perl.appender.Mailer.auth.user       = <YOUR AMAZON SES USER>
log4perl.appender.Mailer.auth.password   = <YOUR AMAZON SES PASSWORD>
log4perl.appender.Mailer.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.Mailer.layout.ConversionPattern = %d - %p > %m%n

Back to Table of Contents

AUTHENTICATION

You must either supply your authentication parameters in the configuration of set SES_SMTP_USER and SES_SMTP_PASS environment variables.

Back to Table of Contents

AUTHOR

Rob Lauer - bigfoot@cpan.org

Back to Table of Contents

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Back to Table of Contents

SEE ALSO

Log::Log4perl, Net::SMTP