Class: LogDb::DbHandler

Inherits:
Object
  • Object
show all
Includes:
Models
Defined in:
lib/logutils/activerecord.rb

Instance Method Summary collapse

Instance Method Details

#write(ev) ⇒ Object



23
24
25
26
27
28
# File 'lib/logutils/activerecord.rb', line 23

def write( ev )
  if( ev.fatal? || ev.error? || ev.warn? || ev.unknown? )
    ## create log entry in db table (logs)
    Log.create!( level: ev.level, msg: ev.msg, pid: ev.pid, tid: ev.tid, ts: ev.ts )
  end
end