log_sense 2.5.2 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89f75b81840da58b73455053de50295235e5afa62a817e2b681000a768c7d71c
4
- data.tar.gz: 792bd5927bd31e6af055e6515fcea976511cb195b86b915d998acbb05dec9050
3
+ metadata.gz: a55bd023db071751705de197fa19c0f50713fc6d37e5644165cdbe9ce7848166
4
+ data.tar.gz: 1573dee63b257e035a0f253c238063856478e9305d1ab78fb4a0131f7cc64d03
5
5
  SHA512:
6
- metadata.gz: be7bee52c0951609c0c2398e86ac7c93e4b670950e593d9962a57f7f2566fbfcf9baa438b03bc9bf06c89c84be5dd45e1e68b642ee7a453edb63bebad40131d8
7
- data.tar.gz: 596d1a6daf73b5c1b80a404abcf4c7cefc6e6faf8432c2e24036f2a9e00e6861b21d66fd377d4627807a0a627f9add9aea0995c641478110bcadb34ff2c9d209
6
+ metadata.gz: 45e2f3aac010fe57eb87d5a9d0384570ab80f70425d425dd96374ae2b5cfdfd3bc44351165a007fd758c4f16d1eef30bac28b359fa51c7a2229486cca2fb1dc5
7
+ data.tar.gz: d4b01c41c0aae899cef4e8aa45a1ba78802a5b10d49c9080c432ffd21497bb11fd2e06db71ef450f45aa5af87cab1e32405ce2aec941784401ad56844e2f4559
data/CHANGELOG.org CHANGED
@@ -2,6 +2,17 @@
2
2
  #+AUTHOR: Adolfo Villafiorita
3
3
  #+STARTUP: showall
4
4
 
5
+ * 2.6.0
6
+
7
+ - BrowserSense can now be used to provide information about browsers
8
+ visiting the app. If you install =browser_sense= and instrument your
9
+ Rails app with it, log_sense can extract information and produce
10
+ appropriate reports.
11
+
12
+ * 2.5.3
13
+
14
+ - Updates versions of bundled gems
15
+
5
16
  * 2.5.2
6
17
 
7
18
  - Fixes a bug in the computation of total events in the Queries/Summary
@@ -67,7 +78,7 @@
67
78
  * 1.8.0
68
79
 
69
80
  - Various improvements to the Rails reports
70
- - Support for BrowserInfo data
81
+ - Support for BrowserSense data
71
82
 
72
83
  * 1.7.0
73
84
 
data/Gemfile.lock CHANGED
@@ -1,45 +1,46 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- log_sense (2.5.1)
5
- browser (~> 6.0.0)
4
+ log_sense (2.5.2)
5
+ browser
6
6
  csv
7
- ipaddr (~> 1.2.0)
8
- iso_country_codes (~> 0.7.0)
7
+ ipaddr
8
+ iso_country_codes
9
9
  ostruct
10
- sqlite3 (~> 2.6.0)
11
- terminal-table (~> 4.0.0)
10
+ sqlite3
11
+ terminal-table
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
16
  ast (2.4.3)
17
- browser (6.0.0)
17
+ browser (6.2.0)
18
18
  bundle-audit (0.1.0)
19
19
  bundler-audit
20
20
  bundler-audit (0.9.2)
21
21
  bundler (>= 1.2.0, < 3)
22
22
  thor (~> 1.0)
23
- csv (3.3.4)
23
+ csv (3.3.5)
24
24
  date (3.4.1)
25
- debug (1.10.0)
25
+ debug (1.11.0)
26
26
  irb (~> 1.10)
27
27
  reline (>= 0.3.8)
28
- io-console (0.8.0)
28
+ erb (5.0.2)
29
+ io-console (0.8.1)
29
30
  ipaddr (1.2.7)
30
31
  irb (1.15.2)
31
32
  pp (>= 0.6.0)
32
33
  rdoc (>= 4.0.0)
33
34
  reline (>= 0.4.2)
34
35
  iso_country_codes (0.7.8)
35
- json (2.12.0)
36
+ json (2.13.2)
36
37
  language_server-protocol (3.17.0.5)
37
38
  lint_roller (1.1.0)
38
39
  mini_portile2 (2.8.9)
39
40
  minitest (5.25.5)
40
- ostruct (0.6.1)
41
+ ostruct (0.6.3)
41
42
  parallel (1.27.0)
42
- parser (3.3.8.0)
43
+ parser (3.3.9.0)
43
44
  ast (~> 2.4.1)
44
45
  racc
45
46
  pp (0.6.2)
@@ -51,13 +52,14 @@ GEM
51
52
  stringio
52
53
  racc (1.8.1)
53
54
  rainbow (3.1.1)
54
- rake (13.2.1)
55
- rdoc (6.13.1)
55
+ rake (13.3.0)
56
+ rdoc (6.14.2)
57
+ erb
56
58
  psych (>= 4.0.0)
57
- regexp_parser (2.10.0)
58
- reline (0.6.1)
59
+ regexp_parser (2.11.2)
60
+ reline (0.6.2)
59
61
  io-console (~> 0.5)
60
- rubocop (1.75.5)
62
+ rubocop (1.80.1)
61
63
  json (~> 2.3)
62
64
  language_server-protocol (~> 3.17.0.2)
63
65
  lint_roller (~> 1.1.0)
@@ -65,20 +67,20 @@ GEM
65
67
  parser (>= 3.3.0.2)
66
68
  rainbow (>= 2.2.2, < 4.0)
67
69
  regexp_parser (>= 2.9.3, < 3.0)
68
- rubocop-ast (>= 1.44.0, < 2.0)
70
+ rubocop-ast (>= 1.46.0, < 2.0)
69
71
  ruby-progressbar (~> 1.7)
70
72
  unicode-display_width (>= 2.4.0, < 4.0)
71
- rubocop-ast (1.44.1)
73
+ rubocop-ast (1.46.0)
72
74
  parser (>= 3.3.7.2)
73
75
  prism (~> 1.4)
74
76
  ruby-progressbar (1.13.0)
75
- sqlite3 (2.6.0)
77
+ sqlite3 (2.7.3)
76
78
  mini_portile2 (~> 2.8.0)
77
79
  stringio (3.1.7)
78
80
  terminal-table (4.0.0)
79
81
  unicode-display_width (>= 1.1.1, < 4)
80
- thor (1.3.2)
81
- unicode-display_width (3.1.4)
82
+ thor (1.4.0)
83
+ unicode-display_width (3.1.5)
82
84
  unicode-emoji (~> 4.0, >= 4.0.4)
83
85
  unicode-emoji (4.0.4)
84
86
 
data/README.org CHANGED
@@ -12,9 +12,10 @@ Main features:
12
12
  - Statistics for Rails app in production and Web server logs (combined format,
13
13
  which can be produced both by Apache and Nginx)
14
14
  - Reports on performances, errors, visitors, and devices used to access your
15
- websites and webapps[fn:: LogSense parses also the data generated by the
16
- BrowserInfo gem, providing additional information for Rails apps, including
17
- devices, platforms and number of accesses to methods by device type.].
15
+ websites and webapps
16
+ - It integrates with =browser_sense= (https://rubygems.org/gems/browser_sense)
17
+ reporting on browser and other users' devices and behaviors, in a
18
+ privacy-respecting manner.
18
19
  - Can combine one or more log files
19
20
  - No need for cookies or other tracking technologies (but you need access to
20
21
  your log files)
@@ -145,7 +146,7 @@ ufw deny from 185.255.134.18
145
146
  ]
146
147
 
147
148
  browser_data_str = browser_data.map { |x| "\"#{x}\"" }.join(',')
148
- logger.info "BrowserInfo: #{browser_data_str}"
149
+ logger.info "BrowserSense: #{browser_data_str}"
149
150
  end
150
151
 
151
152
  # [...]
@@ -78,7 +78,7 @@ module LogSense
78
78
  EOS
79
79
 
80
80
  db.execute <<-EOS
81
- CREATE TABLE IF NOT EXISTS BrowserInfo(
81
+ CREATE TABLE IF NOT EXISTS BrowserSense(
82
82
  id INTEGER PRIMARY KEY AUTOINCREMENT,
83
83
  browser TEXT,
84
84
  platform TEXT,
@@ -92,7 +92,7 @@ module LogSense
92
92
  EOS
93
93
 
94
94
  ins_browser_info = db.prepare <<-EOS
95
- insert into BrowserInfo(
95
+ insert into BrowserSense(
96
96
  browser,
97
97
  platform,
98
98
  device_name,
@@ -560,8 +560,8 @@ module LogSense
560
560
  end
561
561
  end
562
562
 
563
- # I, [2024-07-01T02:21:34.339058 #1392909] INFO -- : [815b3e28-8d6e-4741-8605-87654a9ff58c] BrowserInfo: "Unknown Browser","unknown_platform","Unknown","Devise::SessionsController","new","html","4db749654a0fcacbf3868f87723926e7405262f8d596e8514f4997dc80a3cd7e","2024-07-01T02:21:34+02:00"
564
- BROWSER_INFO_REGEXP = /BrowserInfo: "(?<browser>.+)","(?<platform>.+)","(?<device_name>.+)","(?<controller>.+)","(?<method>.+)","(?<request_format>.+)","(?<anon_ip>.+)","(?<timestamp>.+)"/o
563
+ # I, [2024-07-01T02:21:34.339058 #1392909] INFO -- : [815b3e28-8d6e-4741-8605-87654a9ff58c] BrowserSense: "Unknown Browser","unknown_platform","Unknown","Devise::SessionsController","new","html","4db749654a0fcacbf3868f87723926e7405262f8d596e8514f4997dc80a3cd7e","2024-07-01T02:21:34+02:00"
564
+ BROWSER_INFO_REGEXP = /Browser(Info|Sense): "(?<browser>.+)","(?<platform>.+)","(?<device_name>.+)","(?<controller>.+)","(?<method>.+)","(?<request_format>.+)","(?<anon_ip>.+)","(?<timestamp>.+)"/o
565
565
 
566
566
  def match_and_process_browser_info(line)
567
567
  matchdata = BROWSER_INFO_REGEXP.match line
@@ -119,7 +119,7 @@ module LogSense
119
119
  sum(iif(platform = 'linux', 1, 0)) as Linux,
120
120
  sum(iif(platform != 'ios' and platform != 'android' and platform != 'mac' and platform != 'windows' and platform != 'linux', 1, 0)) as Other,
121
121
  count(distinct(id)) as Total
122
- from BrowserInfo
122
+ from BrowserSense
123
123
  where #{filter}
124
124
  group by controller, method, request_format
125
125
  )
@@ -130,7 +130,7 @@ module LogSense
130
130
  @browsers = @db.execute %Q(
131
131
  SELECT browser as Browser,
132
132
  count(distinct(id)) as Visits
133
- from BrowserInfo
133
+ from BrowserSense
134
134
  where #{filter}
135
135
  group by browser
136
136
  )
@@ -138,7 +138,7 @@ module LogSense
138
138
  @platforms = @db.execute %Q(
139
139
  SELECT platform as Platform,
140
140
  count(distinct(id)) as Visits
141
- from BrowserInfo
141
+ from BrowserSense
142
142
  where #{filter}
143
143
  group by platform
144
144
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LogSense
4
- VERSION = "2.5.2"
4
+ VERSION = "2.6.0"
5
5
  end
data/log_sense.gemspec CHANGED
@@ -6,17 +6,21 @@ Gem::Specification.new do |spec|
6
6
  spec.authors = ["Adolfo Villafiorita"]
7
7
  spec.email = ["adolfo@shair.tech"]
8
8
 
9
- spec.summary = %q{Analyze Rails and Apache/Nginx log file, generating statistics and reports.}
10
- spec.description = %q{log_sense is a command-line command which analyzes Rails and Nginx logs and
11
- provides detailed data about accesses, performances, and errors. It is a
12
- one stop shop solution for analyzing your Rails application in production.
9
+ spec.summary = %q{Analyze Ruby on Rails and Apache/Nginx log files, generating statistics and reports.}
10
+ spec.description = %q{log_sense is a log analysis tool which analyzes Ruby on Rails
11
+ and Apache/Nginx logs and provides detailed data about accesses, performances, and
12
+ errors. It is a one-stop shop solution for analyzing your Rails application
13
+ in production.
13
14
 
14
- Simple to use and working offline, it does not require any modification to
15
- your app (e.g., no need to change the log format, no cookies, no JavaScript
16
- code, no infrastructure to setup).
15
+ Simple to use and working from the command line, it does not require any
16
+ modification to your app (e.g., no need to change the log format, no cookies,
17
+ no JavaScript code, no infrastructure to setup).
17
18
 
18
19
  We use it to monitor our applications in production, using a cron job which
19
20
  pulls the logs and calls log_sense to generate HTML reports.
21
+
22
+ Compatible with Ruby on Rails default logs up to version 8.0.2 and with the
23
+ combined Apache/Nginx format.
20
24
  }
21
25
  spec.homepage = "https://github.com/shair-tech/log_sense/"
22
26
  spec.license = "MIT"
@@ -39,11 +43,11 @@ Gem::Specification.new do |spec|
39
43
 
40
44
  spec.add_dependency "ostruct"
41
45
  spec.add_dependency "csv"
42
- spec.add_dependency "browser", "~> 6.0.0"
43
- spec.add_dependency "ipaddr", "~> 1.2.0"
44
- spec.add_dependency "iso_country_codes", "~> 0.7.0"
45
- spec.add_dependency "sqlite3", "~> 2.6.0"
46
- spec.add_dependency "terminal-table", "~> 4.0.0"
46
+ spec.add_dependency "browser"
47
+ spec.add_dependency "ipaddr"
48
+ spec.add_dependency "iso_country_codes"
49
+ spec.add_dependency "sqlite3"
50
+ spec.add_dependency "terminal-table"
47
51
 
48
52
  spec.add_development_dependency "debug"
49
53
  spec.add_development_dependency "rubocop"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log_sense
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adolfo Villafiorita
@@ -41,72 +41,72 @@ dependencies:
41
41
  name: browser
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 6.0.0
46
+ version: '0'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 6.0.0
53
+ version: '0'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: ipaddr
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - "~>"
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 1.2.0
60
+ version: '0'
61
61
  type: :runtime
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: 1.2.0
67
+ version: '0'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: iso_country_codes
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 0.7.0
74
+ version: '0'
75
75
  type: :runtime
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - "~>"
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: 0.7.0
81
+ version: '0'
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: sqlite3
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - "~>"
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: 2.6.0
88
+ version: '0'
89
89
  type: :runtime
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - "~>"
93
+ - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: 2.6.0
95
+ version: '0'
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: terminal-table
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - "~>"
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: 4.0.0
102
+ version: '0'
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - "~>"
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: 4.0.0
109
+ version: '0'
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: debug
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -163,14 +163,16 @@ dependencies:
163
163
  - - ">="
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
- description: "log_sense is a command-line command which analyzes Rails and Nginx logs
167
- and\n provides detailed data about accesses, performances, and errors. It is
168
- a\n one stop shop solution for analyzing your Rails application in production.\n\n
169
- \ Simple to use and working offline, it does not require any modification to\n
170
- \ your app (e.g., no need to change the log format, no cookies, no JavaScript\n
171
- \ code, no infrastructure to setup).\n\n We use it to monitor our applications
172
- in production, using a cron job which\n pulls the logs and calls log_sense to
173
- generate HTML reports.\n "
166
+ description: "log_sense is a log analysis tool which analyzes Ruby on Rails\n and
167
+ Apache/Nginx logs and provides detailed data about accesses, performances, and\n
168
+ \ errors. It is a one-stop shop solution for analyzing your Rails application\n
169
+ \ in production.\n\n Simple to use and working from the command line, it does
170
+ not require any\n modification to your app (e.g., no need to change the log format,
171
+ no cookies,\n no JavaScript code, no infrastructure to setup).\n\n We use
172
+ it to monitor our applications in production, using a cron job which\n pulls
173
+ the logs and calls log_sense to generate HTML reports.\n\n Compatible with Ruby
174
+ on Rails default logs up to version 8.0.2 and with the\n combined Apache/Nginx
175
+ format.\n "
174
176
  email:
175
177
  - adolfo@shair.tech
176
178
  executables:
@@ -253,5 +255,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
255
  requirements: []
254
256
  rubygems_version: 3.6.7
255
257
  specification_version: 4
256
- summary: Analyze Rails and Apache/Nginx log file, generating statistics and reports.
258
+ summary: Analyze Ruby on Rails and Apache/Nginx log files, generating statistics and
259
+ reports.
257
260
  test_files: []