Module: JMS
- Defined in:
- lib/jms/logging.rb,
lib/jms/connection.rb,
lib/jms/message_listener.rb
Overview
Copyright 2008, 2009, 2010, 2011 J. Reid Morrison
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Defined Under Namespace
Classes: Connection, MessageListener, OracleAQConnectionFactory
Class Method Summary collapse
-
.logger ⇒ Object
Returns the logger being used by jruby-jms Unless previously set, it will try to use the Rails logger and if it is not present, it will return a new Ruby logger.
-
.logger=(logger) ⇒ Object
Replace the logger for jruby-jms.
-
.ruby_logger(level = nil, target = STDOUT) ⇒ Object
Use the ruby logger, but add needed trace level logging which will result in debug log entries.
Class Method Details
.logger ⇒ Object
Returns the logger being used by jruby-jms Unless previously set, it will try to use the Rails logger and if it is not present, it will return a new Ruby logger
7 8 9 |
# File 'lib/jms/logging.rb', line 7 def self.logger @logger ||= (self.rails_logger || self.ruby_logger) end |
.logger=(logger) ⇒ Object
Replace the logger for jruby-jms
12 13 14 |
# File 'lib/jms/logging.rb', line 12 def self.logger=(logger) @logger = logger end |
.ruby_logger(level = nil, target = STDOUT) ⇒ Object
Use the ruby logger, but add needed trace level logging which will result in debug log entries
18 19 20 21 22 23 24 25 26 |
# File 'lib/jms/logging.rb', line 18 def self.ruby_logger(level=nil, target=STDOUT) require 'logger' l = ::Logger.new(target) l.instance_eval "alias :trace :debug" l.instance_eval "alias :trace? :debug?" l.level = level || ::Logger::INFO l end |