in reply to Log4Perl to send mail via SMTP

Hi,

Got it to work this way:

log4perl.rootLogger = ERROR, Email log4perl.appender.Email = Log::Dispatch::Email::MailSender log4perl.appender.Email.name = email log4perl.appender.Email.min_level = error log4perl.appender.Email.to = x@z.com log4perl.appender.Email.from = y@z.com log4perl.appender.Email.subject = Something's broken! log4perl.appender.Email.smtp = smtp.z.com log4perl.appender.Email.layout = SimpleLayout

Replies are listed 'Best First'.
Re: Log4Perl to send mail via SMTP
by Anonymous Monk on Feb 05, 2009 at 19:53 UTC
    This worked for me too after lots of hair pulling.

    Note the difference between:

    Log::Dispatch::Email::MailSender

    in the working example, and:

    Log::Dispatch::Email::MailSend

    in the original, which I also had from somewhere on the web, but was unable to get to work with SMTP, although it does not error, it just writes to mailer.testfile instead.

    Also that:

    log4perl.appender.Email.smtp = smtp.z.com

    is the correct way to specify the server, at least this works for me.

Re^2: Log4Perl to send mail via SMTP
by weismat (Friar) on Nov 24, 2008 at 14:52 UTC
    I see - you are using the smtp server adress as a parameter - I will try this, but it did not work for me before when I added some prints into Mail::Mailer.
    I have written my own appender now - it is the easier solution for me.