common_event_formatter 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/common_event_formatter.rb +6 -2
- metadata +1 -1
@@ -2,10 +2,10 @@ require "logger"
|
|
2
2
|
require "json"
|
3
3
|
|
4
4
|
class CommonEventFormatter < Logger::Formatter
|
5
|
-
VERSION = "0.1.
|
5
|
+
VERSION = "0.1.1"
|
6
6
|
|
7
7
|
def call(severity, time, progname, msg)
|
8
|
-
create_event({:level => severity, :time => time, :app => pwd, :pname => (progname || $0), :msg => msg2str(msg)})
|
8
|
+
create_event({:level => severity, :time => time, :host => hostname, :app => pwd, :pname => (progname || $0), :msg => msg2str(msg)})
|
9
9
|
end
|
10
10
|
|
11
11
|
def create_event(hash)
|
@@ -20,4 +20,8 @@ class CommonEventFormatter < Logger::Formatter
|
|
20
20
|
def process_hash
|
21
21
|
{:pid => Process.pid, :ppid => Process.ppid, :uid => Process.uid, :gid => Process.gid}
|
22
22
|
end
|
23
|
+
|
24
|
+
def hostname
|
25
|
+
ENV["HOSTNAME"]
|
26
|
+
end
|
23
27
|
end
|