rails_log_parser 0.0.18 → 0.0.20
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 +4 -4
- data/README.md +13 -0
- data/lib/rails_log_parser/line.rb +1 -1
- data/lib/rails_log_parser/parser.rb +21 -5
- data/rails_log_parser.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c31d67bb8acb5d41820a3938e3c8120e97092721ff97ae969b68aefcd3f9bf1e
|
|
4
|
+
data.tar.gz: dbc3de4762415ee7e4446cec47c83588be62d08b2734b826239a52ab36a610cb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a20c2012e3abd93dbeb5eb7bc09fbb6113e16d664ea426a635775c328ae286360a0cca1cf908b68fd1549fd9ac3bcfb93631da88f48a904fcd5db529109ab91a
|
|
7
|
+
data.tar.gz: 8b930466f378cba8394fd7d8391ad795f153d68d9e544066d5b7c74b3ba26663c3dd5402c782ab5705ebfe5c0e8e75eb60bb91e2803e7ac0c8c67cd1692cb4a8
|
data/README.md
CHANGED
|
@@ -45,6 +45,11 @@ parser = RailsLogParser::Parser.from_file(log_path)
|
|
|
45
45
|
print parser.summary(last_minutes: 22) # print summary for the last 22 minutes
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
```ruby
|
|
49
|
+
parser = RailsLogParser::Parser.from_journalctl(unit: "myapp.service", since: "1 hour ago")
|
|
50
|
+
print parser.summary(last_minutes: 22) # print summary for the last 22 minutes
|
|
51
|
+
```
|
|
52
|
+
|
|
48
53
|
You can configure filters:
|
|
49
54
|
|
|
50
55
|
```ruby
|
|
@@ -60,6 +65,14 @@ end
|
|
|
60
65
|
|
|
61
66
|
## Changelog
|
|
62
67
|
|
|
68
|
+
### 0.0.20
|
|
69
|
+
|
|
70
|
+
* Add support for journald
|
|
71
|
+
|
|
72
|
+
### 0.0.19
|
|
73
|
+
|
|
74
|
+
* Ignore lines after ActiveJob lines
|
|
75
|
+
|
|
63
76
|
### 0.0.18
|
|
64
77
|
|
|
65
78
|
* Known exceptions given with maximum severity
|
|
@@ -99,7 +99,7 @@ class RailsLogParser::Line
|
|
|
99
99
|
return
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
-
if parser.last_action&.error? || parser.last_action&.fatal?
|
|
102
|
+
if parser.last_action&.error? || parser.last_action&.fatal? || parser.last_action&.active_job?
|
|
103
103
|
parser.last_action.add_stacktrace(line)
|
|
104
104
|
return
|
|
105
105
|
end
|
|
@@ -8,15 +8,31 @@ class RailsLogParser::Parser
|
|
|
8
8
|
@log_path || ENV['LOG_PATH'] || raise('no log_path given')
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def
|
|
11
|
+
def from_io(io)
|
|
12
12
|
parser = new
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
end
|
|
13
|
+
|
|
14
|
+
io.each_line do |line|
|
|
15
|
+
parser.puts(line)
|
|
17
16
|
end
|
|
17
|
+
|
|
18
18
|
parser
|
|
19
19
|
end
|
|
20
|
+
|
|
21
|
+
def from_file(path)
|
|
22
|
+
File.open(path, 'r') do |file|
|
|
23
|
+
from_io(file)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def from_journalctl(unit:, since: nil)
|
|
28
|
+
cmd = ["journalctl", "-u", unit, "-o", "cat"]
|
|
29
|
+
|
|
30
|
+
cmd += ["--since", since] if since
|
|
31
|
+
|
|
32
|
+
IO.popen(cmd, err: [:child, :out]) do |io|
|
|
33
|
+
from_io(io)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
20
36
|
end
|
|
21
37
|
|
|
22
38
|
attr_reader :not_parseable_lines, :last_action
|
data/rails_log_parser.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_log_parser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Georg Limbach
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: enumerize
|
|
@@ -95,7 +95,7 @@ licenses:
|
|
|
95
95
|
metadata:
|
|
96
96
|
homepage_uri: https://github.com/Lichtbit/rails_log_parser
|
|
97
97
|
source_code_uri: https://github.com/Lichtbit/rails_log_parser
|
|
98
|
-
post_install_message:
|
|
98
|
+
post_install_message:
|
|
99
99
|
rdoc_options: []
|
|
100
100
|
require_paths:
|
|
101
101
|
- lib
|
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
111
111
|
version: '0'
|
|
112
112
|
requirements: []
|
|
113
113
|
rubygems_version: 3.3.26
|
|
114
|
-
signing_key:
|
|
114
|
+
signing_key:
|
|
115
115
|
specification_version: 4
|
|
116
116
|
summary: Simple and fast analysing of default rails logs
|
|
117
117
|
test_files: []
|