blooper 1.5 → 1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 %ts.%03tu response_time %tr src_ip %>a squid_request_status %Ss http_status_code %03>Hs reply_size %<st request_method %rm request_url %ru username %un squid_hier_code %Sh dst_ip %<a mime_type %mt
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, %ts.%03tu is a value that will have been written into that column.
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
 
@@ -4,6 +4,6 @@
4
4
  # require 'ap'
5
5
 
6
6
  %w{logger singleton yaml sequel}.each {|lib| require lib}
7
- require_relative '../lib/blooper'
7
+ require 'blooper'
8
8
 
9
9
  Blooper.application.start
@@ -1,10 +1,10 @@
1
- require_relative 'blooper/version.rb'
1
+ require 'blooper/version.rb'
2
2
  BLOOPER_VERSION = Blooper::VERSION
3
3
 
4
- require_relative 'blooper/db.rb'
5
- require_relative 'blooper/input.rb'
6
- require_relative 'blooper/line.rb'
7
- require_relative 'blooper/rows.rb'
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
- -> severity, datetime, appname, msg do
57
- "#{datetime.strftime(DATE_FORMAT)} " +
58
- "#{appname}(#{severity[0]})| " +
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
 
@@ -1,3 +1,3 @@
1
1
  module Blooper
2
- VERSION = "1.5" unless defined?(Blooper::VERSION)
2
+ VERSION = "1.6" unless defined?(Blooper::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blooper
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.5'
4
+ version: '1.6'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: