blooper 1.5 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -2
- data/bin/blooper +1 -1
- data/lib/blooper.rb +9 -13
- data/lib/blooper/version.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -14,11 +14,11 @@ The idea is shamelessly stolen from {logmysqldaemon}[http://sourceforge.net/proj
|
|
14
14
|
|
15
15
|
== Squid configuration
|
16
16
|
|
17
|
-
logformat squid_log time %
|
17
|
+
logformat squid_log time %{%Y-%m-%d_%H:%M:%S%z}tl time_response %tr ip_source %>a squid_request_status %Ss http_status_code %03>Hs http_reply_size %<st http_request_method %rm http_request_url %ru user_name %un squid_hier_code %Sh ip_destination %<a http_content_type %mt
|
18
18
|
access_log daemon:{adapter:postgres,database:squid,username:squid,password:squid,host:db} squid_log
|
19
19
|
logfile_daemon /usr/local/bin/blooper
|
20
20
|
|
21
|
-
1. The column names are dynamic, here time is a column name, %
|
21
|
+
1. The column names are dynamic, here time is a column name, %{%Y-%m-%d_%H:%M:%S%z} is a value that will be written into that column.
|
22
22
|
|
23
23
|
2. The second string contains database access information, the credential depends on {adapter}[http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html], tested only with postgres.
|
24
24
|
|
data/bin/blooper
CHANGED
data/lib/blooper.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
require 'blooper/version.rb'
|
2
2
|
BLOOPER_VERSION = Blooper::VERSION
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
require 'blooper/db.rb'
|
5
|
+
require 'blooper/input.rb'
|
6
|
+
require 'blooper/line.rb'
|
7
|
+
require 'blooper/rows.rb'
|
8
8
|
|
9
9
|
module Blooper
|
10
10
|
|
@@ -40,11 +40,8 @@ module Blooper
|
|
40
40
|
@log.warn('A database connection has been lost, reconnecting...')
|
41
41
|
DB.instance.connect
|
42
42
|
retry
|
43
|
-
rescue Sequel::DatabaseError
|
44
|
-
@log.error('Probably data doesn\'t fit for database')
|
45
|
-
next
|
46
43
|
rescue Sequel::Error => error
|
47
|
-
@log.error(error.message)
|
44
|
+
@log.error(error.message.gsub(/\n.*/s, ''))
|
48
45
|
next
|
49
46
|
end
|
50
47
|
end
|
@@ -53,10 +50,9 @@ module Blooper
|
|
53
50
|
private
|
54
51
|
|
55
52
|
def formatter
|
56
|
-
|
57
|
-
"#{
|
58
|
-
|
59
|
-
"#{msg}\n"
|
53
|
+
-> severity, date_time, app_name, msg do
|
54
|
+
"#{date_time.strftime(DATE_FORMAT)} " +
|
55
|
+
"#{app_name}(#{severity[0]})| #{msg}\n"
|
60
56
|
end
|
61
57
|
end
|
62
58
|
|
data/lib/blooper/version.rb
CHANGED