Class: Ramaze::Logger::Syslog

### Home Classes Methods

### In Files

- lib/ramaze/log/syslog.rb

### Parent

Object

### Methods

- ::new
- #inspect
- #log

### Included Modules

- Ramaze::Logging

### Files

- Gemfile
- Rakefile

### Class/Module Index

Quicksearch

- Ramaze
- Ramaze::App
- Ramaze::Bin
- Ramaze::Bin::Create
- Ramaze::Bin::Runner
- Ramaze::Cache
- Ramaze::Cache::LRU
- Ramaze::Cache::LocalMemCache
- Ramaze::Cache::MemCache
- Ramaze::Cache::Redis
- Ramaze::Cache::Sequel
- Ramaze::Controller
- Ramaze::CoreExtensions
- Ramaze::CoreExtensions::Object
- Ramaze::CoreExtensions::String
- Ramaze::Current
- Ramaze::DefaultController
- Ramaze::Files
- Ramaze::Gestalt
- Ramaze::Helper
- Ramaze::Helper::Auth
- Ramaze::Helper::Bench
- Ramaze::Helper::BlueForm
- Ramaze::Helper::BlueForm::Form
- Ramaze::Helper::CSRF
- Ramaze::Helper::Cache
- Ramaze::Helper::Cache::SingletonMethods
- Ramaze::Helper::Email
- Ramaze::Helper::Erector
- Ramaze::Helper::Flash
- Ramaze::Helper::Formatting
- Ramaze::Helper::Gestalt
- Ramaze::Helper::Gravatar
- Ramaze::Helper::Identity
- Ramaze::Helper::Layout
- Ramaze::Helper::Layout::SingletonMethods
- Ramaze::Helper::Link
- Ramaze::Helper::Localize
- Ramaze::Helper::Localize::Dictionary
- Ramaze::Helper::Localize::Parser
- Ramaze::Helper::Markaby
- Ramaze::Helper::Maruku
- Ramaze::Helper::Paginate
- Ramaze::Helper::Paginate::Paginator
- Ramaze::Helper::Paginate::Paginator::ArrayPager
- Ramaze::Helper::Paginate::Paginator::DataMapperPager
- Ramaze::Helper::Remarkably
- Ramaze::Helper::RequestAccessor
- Ramaze::Helper::SendFile
- Ramaze::Helper::SimpleCaptcha
- Ramaze::Helper::Stack
- Ramaze::Helper::Thread
- Ramaze::Helper::Upload
- Ramaze::Helper::Upload::ClassMethods
- Ramaze::Helper::Upload::UploadedFile
- Ramaze::Helper::UserHelper
- Ramaze::Helper::UserHelper::Wrapper
- Ramaze::Helper::XHTML
- Ramaze::LRUHash
- Ramaze::Logger
- Ramaze::Logger::Informer
- Ramaze::Logger::LogHub
- Ramaze::Logger::Logger
- Ramaze::Logger::RotatingInformer
- Ramaze::Logger::Syslog
- Ramaze::Logging
- Ramaze::Reloader
- Ramaze::Reloader::Hooks
- Ramaze::Reloader::WatchInotify
- Ramaze::Reloader::WatchStat
- Ramaze::Request
- Ramaze::Response
- Ramaze::SpecLogger
- Ramaze::View
- Ramaze::View::Erector
- Ramaze::View::Erubis
- Ramaze::View::Ezamar
- Ramaze::View::Gestalt
- Ramaze::View::Haml
- Ramaze::View::Liquid
- Ramaze::View::Liquid::Tag
- Ramaze::View::Lokar
- Ramaze::View::Mustache
- Ramaze::View::Mustache::RamazeContext
- Ramaze::View::Nagoro
- Ramaze::View::Remarkably
- Ramaze::View::Sass
- Ramaze::View::Slippers
- Ramaze::View::Tagz
- Ramaze::View::Tagz::Methods
- Ramaze::View::Tenjin
- Innate
- Innate::View
- Innate::View::Slim
- Nagoro
- Nagoro::Pipe
- Nagoro::Pipe::RenderPartial
- Bacon
- Bacon::PrettyOutput
- Erector
- Erector::Widget
- Rack
- Rack::RouteExceptions
- Tenjin
- Tenjin::Template
- BlankSlate
- Controller
- MainController
- Object

No matching classes.

# Ramaze::Logger::Syslog

Logger class for writing to syslog. It is a very thin wrapper around the Syslog library.

### Constants

ALIASES

  Hash containing various method aliases. Rbx and Jruby don't seem to like the combination of alias() and module_function() so this works around that.

### Public Class Methods

new(*args) click to toggle source

Open the syslog library, if it is allready open, we reopen it using the new argument list. The argument list is passed on to the Syslog library so please check that, and man syslog for detailed information.

There are 3 parameters:

- ident: The identification used in the log file, defaults to $0

- options: defaults to Syslog::LOG_PID | Syslog::LOG_CONS

- facility: defaults to Syslog::LOG_USER

    # File lib/ramaze/log/syslog.rb, line 32
    def initialize(*args)
      ::Syslog.close if ::Syslog.opened?
      ::Syslog.open(*args)
    end

### Public Instance Methods

inspect() click to toggle source

Has to call the modules singleton-method.

    # File lib/ramaze/log/syslog.rb, line 57
    def inspect
      ::Syslog.inspect
    end

log(tag, *messages) click to toggle source

Just sends all messages received to ::Syslog We simply return if the log was closed for some reason, this behavior was copied from Informer. We do not handle levels here. This will be done by the syslog daemon based on it's configuration.

    # File lib/ramaze/log/syslog.rb, line 42
    def log(tag, *messages)
      return if !::Syslog.opened?
      tag = tag.to_sym

      if ALIASES.key?(tag)
        tag = ALIASES[tag]
      end

      messages = messages.map {|m| m.gsub(/(%[^m])/,'%\1')}
      ::Syslog.send(tag, *messages)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.