Class: Log4r::EmailOutputter

### Home Classes Methods

### In Files

- lib/log4r/outputter/emailoutputter.rb

### Parent

Outputter

### Methods

- ::new
- #flush

### Files

- GDC
- MDC
- NDC
- configurator
- emailoutputter
- formatter
- log4jxmlformatter
- log4r
- logger
- logserver
- outputter
- patternformatter
- scribeoutputter
- syslogoutputter
- win32eventoutputter
- yamlconfigurator

### Class/Module Index

Quicksearch

- Log4r
- Log4r::BasicFormatter
- Log4r::ConfigError
- Log4r::Configurator
- Log4r::DateFileOutputter
- Log4r::DefaultFormatter
- Log4r::EmailOutputter
- Log4r::FileOutputter
- Log4r::Formatter
- Log4r::GDC
- Log4r::IOOutputter
- Log4r::Log4jXmlFormatter
- Log4r::Log4rTools
- Log4r::LogEvent
- Log4r::LogServer
- Log4r::Logger
- Log4r::MDC
- Log4r::NDC
- Log4r::ObjectFormatter
- Log4r::Outputter
- Log4r::PatternFormatter
- Log4r::RemoteOutputter
- Log4r::RollingFileOutputter
- Log4r::RootLogger
- Log4r::ScribeOutputter
- Log4r::SimpleFormatter
- Log4r::StderrOutputter
- Log4r::StdoutOutputter
- Log4r::SyslogOutputter
- Log4r::UDPOutputter
- Log4r::YamlConfigurator
- REXML
- Object

No matching classes.

# Log4r::EmailOutputter

### Attributes

acct[R]
authtype[R]
domain[R]
port[R]
server[R]
subject[R]
tls[R]

### Public Class Methods

new(_name, hash={}) click to toggle source

    # File lib/log4r/outputter/emailoutputter.rb, line 12
    def initialize(_name, hash={})
      super(_name, hash)
      validate(hash)
      @buff = []
      begin
        Logger.log_internal {
          "EmailOutputter '#{@name}' running SMTP client on #{@server}:#{@port}"
        }
      rescue Exception => e
        Logger.log_internal(-2) {
          "EmailOutputter '#{@name}' failed to start SMTP client!"
        }
        Logger.log_internal {e}
        self.level = OFF
        raise e
      end
    end

### Public Instance Methods

flush() click to toggle source

send out an email with the current buffer

    # File lib/log4r/outputter/emailoutputter.rb, line 31
    def flush
      synch { send_mail }
      Logger.log_internal {"Flushed EmailOutputter '#{@name}'"}
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.