Parent

Methods

Log4r::UDPOutputter

Attributes

host[R]

(Not documented)

port[R]

(Not documented)

udpsock[RW]

(Not documented)

Public Class Methods

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

(Not documented)

# File log4r/outputter/udpoutputter.rb, line 18
    def initialize(_name, hash={})
      super(_name, hash)
      @host = hash[:hostname]
      @port = hash[:port]

      begin 
        Logger.log_internal {
          "UDPOutputter will send to #{@host}:#{@port}"
        }
        @udpsock = UDPSocket.new
        @udpsock.connect( @host, @port )
      rescue Exception => e
        Logger.log_internal(ERROR) {
          "UDPOutputter failed to create UDP socket: #{e}"
        }
        Logger.log_internal {e}
        self.level = OFF
        raise e
      end
    end

Private Instance Methods

write(data) click to toggle source
# File log4r/outputter/udpoutputter.rb, line 43
    def write(data)
      @udpsock.send(data, 0)
    rescue Exception => e
      Logger.log_internal(ERROR) {
        "UDPOutputter failed to send data to #{@host}:#{@port}, #{e}"
      }
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.