Module: JMS

Defined in:
lib/jms/imports.rb,
lib/jms/logging.rb,
lib/jms/connection.rb,
lib/jms/session_pool.rb,
lib/jms/message_listener_impl.rb,
lib/jms/oracle_a_q_connection_factory.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

Modules: BytesMessage, MapMessage, Message, MessageConsumer, ObjectMessage, QueueBrowser, Session, TextMessage Classes: Connection, MessageListenerImpl, OracleAQConnectionFactory, SessionPool

Class Method Summary collapse

Class Method Details

.loggerObject

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



23
24
25
# File 'lib/jms/logging.rb', line 23

def self.logger
  @logger ||= (self.rails_logger || self.ruby_logger)
end

.logger=(logger) ⇒ Object

Replace the logger for jruby-jms



28
29
30
# File 'lib/jms/logging.rb', line 28

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



34
35
36
37
38
39
40
41
42
# File 'lib/jms/logging.rb', line 34

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