log_sense 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.org +5 -0
- data/README.org +46 -46
- data/lib/log_sense/apache_report_shaper.rb +267 -163
- data/lib/log_sense/emitter.rb +1 -3
- data/lib/log_sense/rails/log_parser.rb +74 -14
- data/lib/log_sense/rails_aggregator.rb +74 -1
- data/lib/log_sense/rails_report_shaper.rb +330 -107
- data/lib/log_sense/templates/_log_structure.html.erb +6 -6
- data/lib/log_sense/templates/_performance.html.erb +6 -5
- data/lib/log_sense/templates/_rails.css.erb +14 -2
- data/lib/log_sense/templates/_stylesheet.css +26 -8
- data/lib/log_sense/templates/_summary.html.erb +8 -8
- data/lib/log_sense/templates/report_html.erb +18 -2
- data/lib/log_sense/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40a7ce48ddf73fc434bd0df0265e5d16d39e5034b62714f0324ea2a8b56950ca
|
4
|
+
data.tar.gz: c6e4ce814d0276f3a2c2aeaa20051772695c8bf8c8f53cbe10440415bb301dec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b31c02a784d0e3059500f774b090fd40e099d1facd2382195096194ccdecebb5ce601b26b6c04874cc7446e6e625e91be15966d425fc050f3b0be50c67a6985
|
7
|
+
data.tar.gz: 9b79e356ebcaa21b207c24c9ba4c78e39c6865deb4925413aca51b0ce1b705918ca30b61aa205be447547ac428e038239807f82046a9842f7a9d7753037c5fa5
|
data/CHANGELOG.org
CHANGED
data/README.org
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
-
#+TITLE:
|
1
|
+
#+TITLE: LogSense Readme - Monitor your Rails app easy and fast
|
2
2
|
#+AUTHOR: Adolfo Villafiorita
|
3
3
|
#+STARTUP: showall
|
4
4
|
|
5
5
|
* Introduction
|
6
6
|
|
7
|
-
LogSense generates reports and statistics from Apache and Ruby on
|
8
|
-
|
7
|
+
LogSense generates reports and statistics from Apache and Ruby on Rails log
|
8
|
+
files. All the statistics you need to monitor your application, its
|
9
|
+
performances, and how users access your app. Since it collects data from logs,
|
10
|
+
there is no need for cookies or other tracking technologies.
|
11
|
+
|
12
|
+
LogSense is Written in Ruby, it runs from the command line, it is
|
9
13
|
fast, and it can be installed on any system with a relatively recent
|
10
14
|
version of Ruby. We tested on Ruby 2.6.9, Ruby 3.0.x and later.
|
11
15
|
|
@@ -22,6 +26,11 @@ When generating reports, LogSense reports the following data:
|
|
22
26
|
- IP Country location, thanks to the DP-IP lite country DB
|
23
27
|
- Streaks: resources accessed by a given IP over time
|
24
28
|
- Performance of Rails requests
|
29
|
+
- Rails Fatal Errors (with reference to the logs)
|
30
|
+
|
31
|
+
LogSense parses also the data generated by BrowserInfo, providing additional
|
32
|
+
information for Rails apps, including devices and platforms and number of
|
33
|
+
accesses to methods by device type.
|
25
34
|
|
26
35
|
A special output format =ufw= generates rules for the [[https://launchpad.net/ufw][Uncomplicated
|
27
36
|
Firewall]] to blacklist IPs requesting URLs matching a specific pattern.
|
@@ -31,16 +40,16 @@ distinguish traffic generated by self polls and crawlers.
|
|
31
40
|
|
32
41
|
LogSense generates HTML, txt, ufw, and SQLite outputs.
|
33
42
|
|
34
|
-
**
|
43
|
+
** Rails Report Structure
|
35
44
|
|
36
45
|
#+ATTR_HTML: :width 80%
|
37
|
-
[[file:./screenshots/
|
46
|
+
[[file:./screenshots/rails-screenshot.png]]
|
38
47
|
|
39
48
|
|
40
|
-
**
|
49
|
+
** Apache Report Structure
|
41
50
|
|
42
51
|
#+ATTR_HTML: :width 80%
|
43
|
-
[[file:./screenshots/
|
52
|
+
[[file:./screenshots/apache-screenshot.png]]
|
44
53
|
|
45
54
|
|
46
55
|
** UFW Report
|
@@ -78,19 +87,16 @@ opened or code executed.
|
|
78
87
|
|
79
88
|
* Motivation
|
80
89
|
|
81
|
-
LogSense moves along the lines of tools such as [[https://goaccess.io/][GoAccess]]
|
82
|
-
|
83
|
-
|
84
|
-
LogSense is stored on your computer and owned by you (like it should
|
85
|
-
be)[fn:1].
|
86
|
-
|
87
|
-
LogSense is also inspired by *static websites generators*: statistics
|
88
|
-
are generated from the command line and accessed as static HTML files.
|
89
|
-
LogSense thus significantly reduces the attack surface of your
|
90
|
-
web server and installation headaches. We have, for instance, a cron
|
91
|
-
job running on our servers, generating statistics at night. The
|
92
|
-
generated files are then made available on a private area on the web.
|
90
|
+
LogSense moves along the lines of tools such as [[https://goaccess.io/][GoAccess]] and [[https://umami.is/][Umami]], focusing on
|
91
|
+
*privacy*, *data-ownership*, and *simplicity*: no need to install JavaScript
|
92
|
+
snippets, no tracking cookies, just plain and simple log analysis.
|
93
93
|
|
94
|
+
LogSense is also inspired by *static websites generators*: statistics are
|
95
|
+
generated from the command line and accessed as static HTML files. This
|
96
|
+
significantly reduces the attack surface of your web server and installation
|
97
|
+
headaches. We have, for instance, a cron job running on our servers, generating
|
98
|
+
statistics at night. The generated files are then made available on a private
|
99
|
+
area on the web.
|
94
100
|
|
95
101
|
* Installation
|
96
102
|
|
@@ -98,7 +104,6 @@ generated files are then made available on a private area on the web.
|
|
98
104
|
gem install log_sense
|
99
105
|
#+end_src
|
100
106
|
|
101
|
-
|
102
107
|
* Usage
|
103
108
|
|
104
109
|
#+begin_src bash :results raw output :wrap example
|
@@ -108,25 +113,25 @@ generated files are then made available on a private area on the web.
|
|
108
113
|
#+RESULTS:
|
109
114
|
#+begin_example
|
110
115
|
Usage: log_sense [options] [logfile ...]
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
This is version 1.
|
116
|
+
--title=TITLE Title to use in the report
|
117
|
+
-f, --input-format=FORMAT Log format (stored in log or sqlite3): rails or apache (DEFAULT: apache)
|
118
|
+
-i, --input-files=file,file, Input file(s), log file or sqlite3 (can also be passed as arguments)
|
119
|
+
-t, --output-format=FORMAT Output format: html, txt, sqlite, ufw (DEFAULT: html)
|
120
|
+
-o, --output-file=OUTPUT_FILE Output file. (DEFAULT: STDOUT)
|
121
|
+
-b, --begin=DATE Consider only entries after or on DATE
|
122
|
+
-e, --end=DATE Consider only entries before or on DATE
|
123
|
+
-l, --limit=N Limit to the N most requested resources (DEFAULT: 100)
|
124
|
+
-w, --width=WIDTH Maximum width of long columns in textual reports
|
125
|
+
-r, --rows=ROWS Maximum number of rows for columns with multiple entries in textual reports
|
126
|
+
-p, --pattern=PATTERN Pattern to use with ufw report to select IP to blacklist (DEFAULT: php)
|
127
|
+
-c, --crawlers=POLICY Decide what to do with crawlers (applies to Apache Logs)
|
128
|
+
--no-selfpoll Ignore self poll entries (requests from ::1; applies to Apache Logs) (DEFAULT: false)
|
129
|
+
--no-geo Do not geolocate entries (DEFAULT: true)
|
130
|
+
--verbose Inform about progress (output to STDERR) (DEFAULT: false)
|
131
|
+
-v, --version Prints version information
|
132
|
+
-h, --help Prints this help
|
133
|
+
|
134
|
+
This is version 1.8.0
|
130
135
|
|
131
136
|
Output formats:
|
132
137
|
|
@@ -210,8 +215,8 @@ Concerning the outputs:
|
|
210
215
|
|
211
216
|
* Known Bugs
|
212
217
|
|
213
|
-
|
214
|
-
|
218
|
+
We have been running LogSense for quite a few years with no particular issues.
|
219
|
+
There are no known bugs; there is an unknown number of unknown bugs.
|
215
220
|
|
216
221
|
* License
|
217
222
|
|
@@ -220,8 +225,3 @@ Source code distributed under the terms of the [[http://opensource.org/licenses/
|
|
220
225
|
Geolocation is made possible by the DB-IP.com IP to City database,
|
221
226
|
released under a CC license.
|
222
227
|
|
223
|
-
[fn:1] There is a small catch: CSS and JavaScript for layout and plots
|
224
|
-
are downloaded from a CDN. Technically, thus, if you generate HTML
|
225
|
-
reports and open them, a request is performed and the CDN might keep a
|
226
|
-
track (see [[https://en.wikipedia.org/wiki/Content_delivery_network#Security_and_privacy][CDN Security and Privacy on Wikipedia]] for more details).
|
227
|
-
Textual reports don't have this issue.
|