Uploaded image for project: 'Log4php'
  1. Log4php
  2. LOG4PHP-97

LoggerAppenderMailEvent does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.0.0
    • 2.1.0
    • Code
    • Windows Server 2008
      IIS 7
      PHP 5.2

    Description

      I've configured an email appender like this:

      return array(
      'rootLogger' => array(
      'level' => 'DEBUG',
      'appenders' => array('email'),
      ),
      'loggers' => array(
      'ldap' => array(
      'level' => 'DEBUG',
      'appenders' => array('email'),
      ),
      ),
      'appenders' => array(
      'email' => array(
      'class' =>
      'LoggerAppenderMailEvent',
      'layout' => array(
      'class' =>
      'LoggerLayoutPattern',
      'conversionPattern' =>
      "%d

      {Y-m-d H:i:s}

      %-5p %c %X

      {username}

      : %m in %F at %L%n",
      ),
      'from' => 'mail@kfv.at',
      'to' => 'mail@kfv.at',
      'subject' => 'Error',
      'smtpHost' => '0.0.0.0',
      ),
      ),
      );

      But when I try to log, i get the following error:

      PHP Warning: mail() [<a href='function.mail'>function.mail</a>]:
      "sendmail_from" not set in php.ini or custom "From:"
      header missing in ..\log4php\appenders\LoggerAppenderMailEvent.php on line
      166
      PHP Fatal error: Uncaught exception 'LoggerException' with message 'Error
      sending mail to ''!' in
      ..\log4php\appenders\LoggerAppenderMailEvent.php:169
      Stack trace:
      #0 ..\log4php\LoggerAppender.php(134):
      LoggerAppenderMailEvent->append(Object(LoggerLoggingEvent))
      #1 ..\log4php\Logger.php(410):
      LoggerAppender->doAppend(Object(LoggerLoggingEvent))
      #2 ..\log4php\Logger.php(273):
      Logger->callAppenders(Object(LoggerLoggingEvent))
      #3 ..\log4php\Logger.php(331): Logger->forcedLog('Logger', NULL,
      Object(LoggerLevel), 'Testlog')
      #4 ..\log4php\Logger.php(216): Logger->logLevel('Testlog',
      Object(LoggerLevel), NULL)
      #5 ..\Ldap.class.php(9): Logger->debug('Testlog')
      ...
      thrown in ..\log4php\appenders\LoggerAppenderMailEvent.php on line 169

      Attachments

        Activity

          People

            Unassigned Unassigned
            flotschi Florian Platzer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified