macklog 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +11 -0
- data/lib/macklog/cli.rb +1 -1
- data/lib/macklog/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a62fda172422a1b1139963a312898ac0f630159b
|
4
|
+
data.tar.gz: 93cce5305c530eb41283a5aaa2bf594c9d3f111a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04d1ff56fafb4e2b4adff8f8590e9fa906baccba03b0787c5fa8341585d7e26a2ed4e31a97d8033eac4098a727d278b03adca332c569c73be64fbd04e5cd11c4
|
7
|
+
data.tar.gz: 500d341e87ed5c77bda24669238abaec1fd8eaaf0ea804c3ed76702b6d1b3ceff00c0be2821f81b89b47294c279efe93f5bd0f1efb98845c400cb9d937884702
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -21,6 +21,17 @@ gem 'macklog'
|
|
21
21
|
command = "macklog -f /var/log/httpd/error.log -w fatal -i"
|
22
22
|
```
|
23
23
|
|
24
|
+
### options
|
25
|
+
```
|
26
|
+
-f : 対象ファイル
|
27
|
+
-w : 対象キーワード
|
28
|
+
-i : 大文字小文字を区別しない
|
29
|
+
```
|
30
|
+
|
31
|
+
同じアラートを複数回通知しないために、履歴を/tmpディレクトリ配下のファイルで行っています。
|
32
|
+
/tmp以外で行う場合は、`export MACKLOG_TMP=/var/tmp`のように環境変数に指定を行って下さい。
|
33
|
+
|
34
|
+
|
24
35
|
## Contributing
|
25
36
|
|
26
37
|
1. Fork it ( https://github.com/[my-github-username]/macklog/fork )
|
data/lib/macklog/cli.rb
CHANGED
@@ -39,7 +39,7 @@ module Macklog
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def notified?(file_path, record)
|
42
|
-
tmp_path = ENV["
|
42
|
+
tmp_path = ENV["MACKLOG_TMP"] ? ENV["MACKLOG_TMP"] : "/tmp"
|
43
43
|
tmp_path << "/macklog_#{File.basename(file_path, '.*')}.tmp"
|
44
44
|
|
45
45
|
unless File.exist?(tmp_path) && File.readlines(tmp_path).map(&:chomp).include?(record)
|
data/lib/macklog/version.rb
CHANGED