Module: MongoidLogger::LogCollection
- Defined in:
- lib/mongoid_logger/log_collection.rb
Overview
ログコレクションのためのモジュール
Class Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/mongoid_logger/log_collection.rb', line 8 def self.included(klass) klass.class_eval do include Mongoid::Document field :request_time, :type => ActiveSupport::TimeWithZone field :application_name, :type => String field :level, :type => Integer field :host, :type => String field :pid, :type => Integer field :request_method, :type => String field :path, :type => String field :url, :type => String field :params, :type => Object field :remote_ip, :type => String field :messages, :type => Array field :runtime, :type => Float field :status, :type => Integer def level_name LOG_LEVEL_SYM[level] end end end |