logster 2.12.2 → 2.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +5 -0
- data/.streerc +2 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +1 -1
- data/README.md +7 -6
- data/assets/javascript/{chunk.143.f61340b825c6a3bf6dbe.js → chunk.143.5bf090e78cbca9ee78cc.js} +4 -4
- data/assets/javascript/{chunk.178.6d9ae01775c898e7b748.js → chunk.178.135370942038cfbbe65e.js} +3 -3
- data/assets/javascript/client-app.js +103 -35
- data/client-app/app/controllers/show.js +17 -1
- data/client-app/app/templates/show.hbs +2 -0
- data/client-app/package.json +1 -1
- data/client-app/preload-json-manager.rb +10 -17
- data/client-app/yarn.lock +131 -44
- data/lib/examples/sidekiq_logster_reporter.rb +5 -7
- data/lib/logster/base_store.rb +26 -22
- data/lib/logster/cache.rb +2 -1
- data/lib/logster/configuration.rb +3 -3
- data/lib/logster/defer_logger.rb +2 -4
- data/lib/logster/group.rb +17 -20
- data/lib/logster/ignore_pattern.rb +1 -2
- data/lib/logster/logger.rb +18 -16
- data/lib/logster/message.rb +53 -57
- data/lib/logster/middleware/debug_exceptions.rb +12 -10
- data/lib/logster/middleware/reporter.rb +17 -26
- data/lib/logster/middleware/viewer.rb +77 -97
- data/lib/logster/pattern.rb +4 -7
- data/lib/logster/rails/railtie.rb +10 -13
- data/lib/logster/redis_rate_limiter.rb +2 -7
- data/lib/logster/redis_store.rb +79 -99
- data/lib/logster/scheduler.rb +1 -5
- data/lib/logster/suppression_pattern.rb +7 -5
- data/lib/logster/version.rb +1 -1
- data/lib/logster/web.rb +1 -1
- data/lib/logster.rb +15 -17
- data/logster.gemspec +14 -14
- data/test/examples/test_sidekiq_reporter_example.rb +8 -9
- data/test/fake_data/generate.rb +14 -3
- data/test/logster/middleware/test_reporter.rb +9 -7
- data/test/logster/middleware/test_viewer.rb +117 -101
- data/test/logster/test_base_store.rb +79 -58
- data/test/logster/test_cache.rb +5 -11
- data/test/logster/test_defer_logger.rb +3 -3
- data/test/logster/test_group.rb +14 -18
- data/test/logster/test_ignore_pattern.rb +2 -3
- data/test/logster/test_logger.rb +14 -14
- data/test/logster/test_message.rb +29 -31
- data/test/logster/test_pattern.rb +7 -15
- data/test/logster/test_redis_rate_limiter.rb +35 -21
- data/test/logster/test_redis_store.rb +239 -151
- data/test/test_helper.rb +9 -9
- metadata +19 -4
data/client-app/yarn.lock
CHANGED
@@ -17,6 +17,14 @@
|
|
17
17
|
dependencies:
|
18
18
|
"@babel/highlight" "^7.18.6"
|
19
19
|
|
20
|
+
"@babel/code-frame@^7.22.13":
|
21
|
+
version "7.22.13"
|
22
|
+
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e"
|
23
|
+
integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==
|
24
|
+
dependencies:
|
25
|
+
"@babel/highlight" "^7.22.13"
|
26
|
+
chalk "^2.4.2"
|
27
|
+
|
20
28
|
"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.1", "@babel/compat-data@^7.20.5":
|
21
29
|
version "7.21.0"
|
22
30
|
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.0.tgz#c241dc454e5b5917e40d37e525e2f4530c399298"
|
@@ -52,7 +60,7 @@
|
|
52
60
|
eslint-visitor-keys "^2.1.0"
|
53
61
|
semver "^6.3.0"
|
54
62
|
|
55
|
-
"@babel/generator@^7.21.0"
|
63
|
+
"@babel/generator@^7.21.0":
|
56
64
|
version "7.21.1"
|
57
65
|
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.1.tgz#951cc626057bc0af2c35cd23e9c64d384dea83dd"
|
58
66
|
integrity sha512-1lT45bAYlQhFn/BHivJs43AiW2rg3/UbLyShGfF3C0KmHvO5fSghWd5kBJy30kpRRucGzXStvnnCFniCR2kXAA==
|
@@ -62,6 +70,16 @@
|
|
62
70
|
"@jridgewell/trace-mapping" "^0.3.17"
|
63
71
|
jsesc "^2.5.1"
|
64
72
|
|
73
|
+
"@babel/generator@^7.23.0":
|
74
|
+
version "7.23.0"
|
75
|
+
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420"
|
76
|
+
integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==
|
77
|
+
dependencies:
|
78
|
+
"@babel/types" "^7.23.0"
|
79
|
+
"@jridgewell/gen-mapping" "^0.3.2"
|
80
|
+
"@jridgewell/trace-mapping" "^0.3.17"
|
81
|
+
jsesc "^2.5.1"
|
82
|
+
|
65
83
|
"@babel/helper-annotate-as-pure@^7.18.6":
|
66
84
|
version "7.18.6"
|
67
85
|
resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb"
|
@@ -127,6 +145,11 @@
|
|
127
145
|
resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be"
|
128
146
|
integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==
|
129
147
|
|
148
|
+
"@babel/helper-environment-visitor@^7.22.20":
|
149
|
+
version "7.22.20"
|
150
|
+
resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167"
|
151
|
+
integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==
|
152
|
+
|
130
153
|
"@babel/helper-explode-assignable-expression@^7.18.6":
|
131
154
|
version "7.18.6"
|
132
155
|
resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096"
|
@@ -142,6 +165,14 @@
|
|
142
165
|
"@babel/template" "^7.20.7"
|
143
166
|
"@babel/types" "^7.21.0"
|
144
167
|
|
168
|
+
"@babel/helper-function-name@^7.23.0":
|
169
|
+
version "7.23.0"
|
170
|
+
resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759"
|
171
|
+
integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==
|
172
|
+
dependencies:
|
173
|
+
"@babel/template" "^7.22.15"
|
174
|
+
"@babel/types" "^7.23.0"
|
175
|
+
|
145
176
|
"@babel/helper-hoist-variables@^7.18.6":
|
146
177
|
version "7.18.6"
|
147
178
|
resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678"
|
@@ -149,6 +180,13 @@
|
|
149
180
|
dependencies:
|
150
181
|
"@babel/types" "^7.18.6"
|
151
182
|
|
183
|
+
"@babel/helper-hoist-variables@^7.22.5":
|
184
|
+
version "7.22.5"
|
185
|
+
resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb"
|
186
|
+
integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==
|
187
|
+
dependencies:
|
188
|
+
"@babel/types" "^7.22.5"
|
189
|
+
|
152
190
|
"@babel/helper-member-expression-to-functions@^7.20.7", "@babel/helper-member-expression-to-functions@^7.21.0":
|
153
191
|
version "7.21.0"
|
154
192
|
resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.0.tgz#319c6a940431a133897148515877d2f3269c3ba5"
|
@@ -232,16 +270,33 @@
|
|
232
270
|
dependencies:
|
233
271
|
"@babel/types" "^7.18.6"
|
234
272
|
|
273
|
+
"@babel/helper-split-export-declaration@^7.22.6":
|
274
|
+
version "7.22.6"
|
275
|
+
resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c"
|
276
|
+
integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==
|
277
|
+
dependencies:
|
278
|
+
"@babel/types" "^7.22.5"
|
279
|
+
|
235
280
|
"@babel/helper-string-parser@^7.19.4":
|
236
281
|
version "7.19.4"
|
237
282
|
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63"
|
238
283
|
integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==
|
239
284
|
|
285
|
+
"@babel/helper-string-parser@^7.22.5":
|
286
|
+
version "7.22.5"
|
287
|
+
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f"
|
288
|
+
integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==
|
289
|
+
|
240
290
|
"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1":
|
241
291
|
version "7.19.1"
|
242
292
|
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2"
|
243
293
|
integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==
|
244
294
|
|
295
|
+
"@babel/helper-validator-identifier@^7.22.20":
|
296
|
+
version "7.22.20"
|
297
|
+
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0"
|
298
|
+
integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==
|
299
|
+
|
245
300
|
"@babel/helper-validator-option@^7.18.6":
|
246
301
|
version "7.21.0"
|
247
302
|
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180"
|
@@ -275,11 +330,25 @@
|
|
275
330
|
chalk "^2.0.0"
|
276
331
|
js-tokens "^4.0.0"
|
277
332
|
|
278
|
-
"@babel/
|
333
|
+
"@babel/highlight@^7.22.13":
|
334
|
+
version "7.22.20"
|
335
|
+
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54"
|
336
|
+
integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==
|
337
|
+
dependencies:
|
338
|
+
"@babel/helper-validator-identifier" "^7.22.20"
|
339
|
+
chalk "^2.4.2"
|
340
|
+
js-tokens "^4.0.0"
|
341
|
+
|
342
|
+
"@babel/parser@^7.20.7", "@babel/parser@^7.21.0", "@babel/parser@^7.4.5", "@babel/parser@^7.7.0":
|
279
343
|
version "7.21.2"
|
280
344
|
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.2.tgz#dacafadfc6d7654c3051a66d6fe55b6cb2f2a0b3"
|
281
345
|
integrity sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ==
|
282
346
|
|
347
|
+
"@babel/parser@^7.22.15", "@babel/parser@^7.23.0":
|
348
|
+
version "7.23.0"
|
349
|
+
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719"
|
350
|
+
integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==
|
351
|
+
|
283
352
|
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6":
|
284
353
|
version "7.18.6"
|
285
354
|
resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2"
|
@@ -979,19 +1048,28 @@
|
|
979
1048
|
"@babel/parser" "^7.20.7"
|
980
1049
|
"@babel/types" "^7.20.7"
|
981
1050
|
|
982
|
-
"@babel/
|
983
|
-
version "7.
|
984
|
-
resolved "https://registry.yarnpkg.com/@babel/
|
985
|
-
integrity sha512-
|
1051
|
+
"@babel/template@^7.22.15":
|
1052
|
+
version "7.22.15"
|
1053
|
+
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38"
|
1054
|
+
integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==
|
986
1055
|
dependencies:
|
987
|
-
"@babel/code-frame" "^7.
|
988
|
-
"@babel/
|
989
|
-
"@babel/
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
1056
|
+
"@babel/code-frame" "^7.22.13"
|
1057
|
+
"@babel/parser" "^7.22.15"
|
1058
|
+
"@babel/types" "^7.22.15"
|
1059
|
+
|
1060
|
+
"@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.4.5", "@babel/traverse@^7.7.0":
|
1061
|
+
version "7.23.2"
|
1062
|
+
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8"
|
1063
|
+
integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==
|
1064
|
+
dependencies:
|
1065
|
+
"@babel/code-frame" "^7.22.13"
|
1066
|
+
"@babel/generator" "^7.23.0"
|
1067
|
+
"@babel/helper-environment-visitor" "^7.22.20"
|
1068
|
+
"@babel/helper-function-name" "^7.23.0"
|
1069
|
+
"@babel/helper-hoist-variables" "^7.22.5"
|
1070
|
+
"@babel/helper-split-export-declaration" "^7.22.6"
|
1071
|
+
"@babel/parser" "^7.23.0"
|
1072
|
+
"@babel/types" "^7.23.0"
|
995
1073
|
debug "^4.1.0"
|
996
1074
|
globals "^11.1.0"
|
997
1075
|
|
@@ -1004,6 +1082,15 @@
|
|
1004
1082
|
"@babel/helper-validator-identifier" "^7.19.1"
|
1005
1083
|
to-fast-properties "^2.0.0"
|
1006
1084
|
|
1085
|
+
"@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0":
|
1086
|
+
version "7.23.0"
|
1087
|
+
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb"
|
1088
|
+
integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==
|
1089
|
+
dependencies:
|
1090
|
+
"@babel/helper-string-parser" "^7.22.5"
|
1091
|
+
"@babel/helper-validator-identifier" "^7.22.20"
|
1092
|
+
to-fast-properties "^2.0.0"
|
1093
|
+
|
1007
1094
|
"@cnakazawa/watch@^1.0.3":
|
1008
1095
|
version "1.0.4"
|
1009
1096
|
resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a"
|
@@ -4275,9 +4362,9 @@ engine.io-parser@~5.0.3:
|
|
4275
4362
|
integrity sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==
|
4276
4363
|
|
4277
4364
|
engine.io@~6.4.1:
|
4278
|
-
version "6.4.
|
4279
|
-
resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-6.4.
|
4280
|
-
integrity sha512-
|
4365
|
+
version "6.4.2"
|
4366
|
+
resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-6.4.2.tgz#ffeaf68f69b1364b0286badddf15ff633476473f"
|
4367
|
+
integrity sha512-FKn/3oMiJjrOEOeUub2WCox6JhxBXq/Zn3fZOMCBxKnNYtsdKjxhl7yR3fZhM9PV+rdE75SU5SYMc+2PGzo+Tg==
|
4281
4368
|
dependencies:
|
4282
4369
|
"@types/cookie" "^0.4.1"
|
4283
4370
|
"@types/cors" "^2.8.12"
|
@@ -7039,10 +7126,10 @@ mute-stream@0.0.8:
|
|
7039
7126
|
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
|
7040
7127
|
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
|
7041
7128
|
|
7042
|
-
nanoid@^3.3.
|
7043
|
-
version "3.3.
|
7044
|
-
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.
|
7045
|
-
integrity sha512-
|
7129
|
+
nanoid@^3.3.6:
|
7130
|
+
version "3.3.6"
|
7131
|
+
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c"
|
7132
|
+
integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==
|
7046
7133
|
|
7047
7134
|
nanomatch@^1.2.9:
|
7048
7135
|
version "1.2.13"
|
@@ -7697,11 +7784,11 @@ postcss-value-parser@^4.1.0:
|
|
7697
7784
|
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
|
7698
7785
|
|
7699
7786
|
postcss@^8.2.15:
|
7700
|
-
version "8.4.
|
7701
|
-
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.
|
7702
|
-
integrity sha512-
|
7787
|
+
version "8.4.31"
|
7788
|
+
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d"
|
7789
|
+
integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==
|
7703
7790
|
dependencies:
|
7704
|
-
nanoid "^3.3.
|
7791
|
+
nanoid "^3.3.6"
|
7705
7792
|
picocolors "^1.0.0"
|
7706
7793
|
source-map-js "^1.0.2"
|
7707
7794
|
|
@@ -8268,19 +8355,19 @@ schema-utils@^4.0.0:
|
|
8268
8355
|
ajv-keywords "^5.0.0"
|
8269
8356
|
|
8270
8357
|
"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0:
|
8271
|
-
version "5.7.
|
8272
|
-
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.
|
8273
|
-
integrity sha512-
|
8358
|
+
version "5.7.2"
|
8359
|
+
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
|
8360
|
+
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==
|
8274
8361
|
|
8275
8362
|
semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
|
8276
|
-
version "6.3.
|
8277
|
-
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.
|
8278
|
-
integrity sha512-
|
8363
|
+
version "6.3.1"
|
8364
|
+
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
|
8365
|
+
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
|
8279
8366
|
|
8280
8367
|
semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.8:
|
8281
|
-
version "7.
|
8282
|
-
resolved "https://registry.yarnpkg.com/semver/-/semver-7.
|
8283
|
-
integrity sha512-
|
8368
|
+
version "7.5.4"
|
8369
|
+
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
|
8370
|
+
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
|
8284
8371
|
dependencies:
|
8285
8372
|
lru-cache "^6.0.0"
|
8286
8373
|
|
@@ -8478,9 +8565,9 @@ socket.io-adapter@~2.5.2:
|
|
8478
8565
|
ws "~8.11.0"
|
8479
8566
|
|
8480
8567
|
socket.io-parser@~4.2.1:
|
8481
|
-
version "4.2.
|
8482
|
-
resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.2.
|
8483
|
-
integrity sha512-
|
8568
|
+
version "4.2.3"
|
8569
|
+
resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.2.3.tgz#926bcc6658e2ae0883dc9dee69acbdc76e4e3667"
|
8570
|
+
integrity sha512-JMafRntWVO2DCJimKsRTh/wnqVvO4hrfwOqtO7f+uzwsQMuxO6VwImtYxaQ+ieoyshWOTJyV0fA21lccEXRPpQ==
|
8484
8571
|
dependencies:
|
8485
8572
|
"@socket.io/component-emitter" "~3.1.0"
|
8486
8573
|
debug "~4.3.1"
|
@@ -9447,10 +9534,10 @@ webpack-sources@^3.2.3:
|
|
9447
9534
|
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
|
9448
9535
|
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
|
9449
9536
|
|
9450
|
-
webpack@^5.
|
9451
|
-
version "5.
|
9452
|
-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.
|
9453
|
-
integrity sha512-
|
9537
|
+
webpack@^5.76.0:
|
9538
|
+
version "5.76.0"
|
9539
|
+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.76.0.tgz#f9fb9fb8c4a7dbdcd0d56a98e56b8a942ee2692c"
|
9540
|
+
integrity sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA==
|
9454
9541
|
dependencies:
|
9455
9542
|
"@types/eslint-scope" "^3.7.3"
|
9456
9543
|
"@types/estree" "^0.0.51"
|
@@ -9554,9 +9641,9 @@ wide-align@^1.1.5:
|
|
9554
9641
|
string-width "^1.0.2 || 2 || 3 || 4"
|
9555
9642
|
|
9556
9643
|
word-wrap@^1.2.3:
|
9557
|
-
version "1.2.
|
9558
|
-
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.
|
9559
|
-
integrity sha512-
|
9644
|
+
version "1.2.4"
|
9645
|
+
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f"
|
9646
|
+
integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==
|
9560
9647
|
|
9561
9648
|
wordwrap@^0.0.3:
|
9562
9649
|
version "0.0.3"
|
@@ -4,19 +4,17 @@ class SidekiqLogsterReporter
|
|
4
4
|
def call(ex, context = {})
|
5
5
|
# Pass context to Logster
|
6
6
|
fake_env = {}
|
7
|
-
context.each
|
8
|
-
Logster.add_to_env(fake_env, key, value)
|
9
|
-
end
|
7
|
+
context.each { |key, value| Logster.add_to_env(fake_env, key, value) }
|
10
8
|
|
11
9
|
text = "Job exception: #{ex}\n"
|
12
|
-
if ex.backtrace
|
13
|
-
Logster.add_to_env(fake_env, :backtrace, ex.backtrace)
|
14
|
-
end
|
10
|
+
Logster.add_to_env(fake_env, :backtrace, ex.backtrace) if ex.backtrace
|
15
11
|
|
16
12
|
Thread.current[Logster::Logger::LOGSTER_ENV] = fake_env
|
17
13
|
Logster.logger.error(text)
|
18
14
|
rescue => e
|
19
|
-
Logster.logger.fatal(
|
15
|
+
Logster.logger.fatal(
|
16
|
+
"Failed to log exception #{ex} #{hash}\nReason: #{e.class} #{e}\n#{e.backtrace.join("\n")}",
|
17
|
+
)
|
20
18
|
ensure
|
21
19
|
Thread.current[Logster::Logger::LOGSTER_ENV] = nil
|
22
20
|
end
|
data/lib/logster/base_store.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Logster
|
4
4
|
class BaseStore
|
5
|
-
|
6
5
|
attr_accessor :level, :max_retention, :skip_empty, :ignore, :allow_custom_patterns
|
7
6
|
|
8
7
|
def initialize
|
@@ -166,31 +165,35 @@ module Logster
|
|
166
165
|
message.populate_from_env(env)
|
167
166
|
|
168
167
|
if backtrace
|
169
|
-
if backtrace.respond_to? :join
|
170
|
-
backtrace = backtrace.join("\n")
|
171
|
-
end
|
168
|
+
backtrace = backtrace.join("\n") if backtrace.respond_to? :join
|
172
169
|
message.backtrace = backtrace
|
173
170
|
else
|
174
171
|
message.backtrace = caller.join("\n")
|
175
172
|
end
|
176
173
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
174
|
+
if ignore &&
|
175
|
+
ignore.any? { |pattern|
|
176
|
+
if message =~ pattern
|
177
|
+
val = Regexp === pattern ? pattern.inspect : pattern.to_s
|
178
|
+
increment_ignore_count(val)
|
179
|
+
true
|
180
|
+
end
|
181
|
+
}
|
182
|
+
return
|
183
183
|
end
|
184
184
|
|
185
185
|
if Logster.config.enable_custom_patterns_via_ui || allow_custom_patterns
|
186
|
-
custom_ignore =
|
187
|
-
Logster::SuppressionPattern
|
188
|
-
|
189
|
-
return if custom_ignore.any? do |pattern|
|
190
|
-
if message =~ pattern
|
191
|
-
increment_ignore_count(pattern.inspect)
|
192
|
-
true
|
186
|
+
custom_ignore =
|
187
|
+
@patterns_cache.fetch(Logster::SuppressionPattern::CACHE_KEY) do
|
188
|
+
Logster::SuppressionPattern.find_all(store: self)
|
193
189
|
end
|
190
|
+
if custom_ignore.any? { |pattern|
|
191
|
+
if message =~ pattern
|
192
|
+
increment_ignore_count(pattern.inspect)
|
193
|
+
true
|
194
|
+
end
|
195
|
+
}
|
196
|
+
return
|
194
197
|
end
|
195
198
|
end
|
196
199
|
|
@@ -199,7 +202,7 @@ module Logster
|
|
199
202
|
if Logster.config.allow_grouping
|
200
203
|
message.apply_message_size_limit(
|
201
204
|
Logster.config.maximum_message_size_bytes,
|
202
|
-
gems_dir: Logster.config.gems_dir
|
205
|
+
gems_dir: Logster.config.gems_dir,
|
203
206
|
)
|
204
207
|
key = self.similar_key(message)
|
205
208
|
similar = get(key, load_env: false) if key
|
@@ -215,7 +218,7 @@ module Logster
|
|
215
218
|
else
|
216
219
|
message.apply_message_size_limit(
|
217
220
|
Logster.config.maximum_message_size_bytes,
|
218
|
-
gems_dir: Logster.config.gems_dir
|
221
|
+
gems_dir: Logster.config.gems_dir,
|
219
222
|
)
|
220
223
|
saved = save(message)
|
221
224
|
message
|
@@ -224,9 +227,10 @@ module Logster
|
|
224
227
|
message = similar || message
|
225
228
|
|
226
229
|
if (Logster.config.enable_custom_patterns_via_ui || allow_custom_patterns) && saved
|
227
|
-
grouping_patterns =
|
228
|
-
Logster::GroupingPattern
|
229
|
-
|
230
|
+
grouping_patterns =
|
231
|
+
@patterns_cache.fetch(Logster::GroupingPattern::CACHE_KEY) do
|
232
|
+
Logster::GroupingPattern.find_all(store: self)
|
233
|
+
end
|
230
234
|
|
231
235
|
grouping_patterns.each do |pattern|
|
232
236
|
if message =~ pattern
|
data/lib/logster/cache.rb
CHANGED
@@ -8,7 +8,8 @@ module Logster
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def fetch(key)
|
11
|
-
if !@hash.key?(key) ||
|
11
|
+
if !@hash.key?(key) ||
|
12
|
+
@hash[key][:created_at] + @age < Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
12
13
|
@hash[key] = { data: yield, created_at: Process.clock_gettime(Process::CLOCK_MONOTONIC) }
|
13
14
|
end
|
14
15
|
@hash[key][:data]
|
@@ -19,7 +19,7 @@ module Logster
|
|
19
19
|
:max_env_bytes,
|
20
20
|
:max_env_count_per_message,
|
21
21
|
:maximum_message_length,
|
22
|
-
:use_full_hostname
|
22
|
+
:use_full_hostname,
|
23
23
|
)
|
24
24
|
|
25
25
|
attr_writer :subdirectory
|
@@ -27,7 +27,7 @@ module Logster
|
|
27
27
|
def initialize
|
28
28
|
# lambda |env,block|
|
29
29
|
@current_context = lambda { |_, &block| block.call }
|
30
|
-
@environments = [
|
30
|
+
@environments = %i[development production]
|
31
31
|
@subdirectory = nil
|
32
32
|
@env_expandable_keys = []
|
33
33
|
@enable_custom_patterns_via_ui = false
|
@@ -50,7 +50,7 @@ module Logster
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def subdirectory
|
53
|
-
@subdirectory ||
|
53
|
+
@subdirectory || "/logs"
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
data/lib/logster/defer_logger.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "logster/scheduler"
|
4
4
|
|
5
5
|
module Logster
|
6
6
|
class DeferLogger < ::Logster::Logger
|
@@ -8,9 +8,7 @@ module Logster
|
|
8
8
|
|
9
9
|
def report_to_store(severity, progname, message, opts = {})
|
10
10
|
opts[:backtrace] ||= caller.join("\n")
|
11
|
-
Logster::Scheduler.schedule
|
12
|
-
super(severity, progname, message, opts)
|
13
|
-
end
|
11
|
+
Logster::Scheduler.schedule { super(severity, progname, message, opts) }
|
14
12
|
end
|
15
13
|
end
|
16
14
|
end
|
data/lib/logster/group.rb
CHANGED
@@ -17,12 +17,13 @@ module Logster
|
|
17
17
|
|
18
18
|
def self.from_json(json)
|
19
19
|
hash = JSON.parse(json)
|
20
|
-
group =
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
group =
|
21
|
+
new(
|
22
|
+
hash["key"],
|
23
|
+
hash["messages_keys"],
|
24
|
+
timestamp: hash["timestamp"] || 0,
|
25
|
+
count: hash["count"] || 0,
|
26
|
+
)
|
26
27
|
group.changed = false
|
27
28
|
group
|
28
29
|
end
|
@@ -32,12 +33,7 @@ module Logster
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def to_h
|
35
|
-
{
|
36
|
-
key: @key,
|
37
|
-
messages_keys: @messages_keys,
|
38
|
-
timestamp: @timestamp,
|
39
|
-
count: @count
|
40
|
-
}
|
36
|
+
{ key: @key, messages_keys: @messages_keys, timestamp: @timestamp, count: @count }
|
41
37
|
end
|
42
38
|
|
43
39
|
def to_h_web
|
@@ -47,7 +43,7 @@ module Logster
|
|
47
43
|
timestamp: @timestamp,
|
48
44
|
messages: @messages,
|
49
45
|
severity: -1,
|
50
|
-
group: true
|
46
|
+
group: true,
|
51
47
|
}
|
52
48
|
end
|
53
49
|
|
@@ -111,14 +107,15 @@ module Logster
|
|
111
107
|
self.class.max_size
|
112
108
|
end
|
113
109
|
|
114
|
-
GroupWeb =
|
115
|
-
|
116
|
-
|
117
|
-
|
110
|
+
GroupWeb =
|
111
|
+
Struct.new(*%i[regex count timestamp messages row_id]) do
|
112
|
+
def to_json(opts = nil)
|
113
|
+
JSON.fast_generate(self.to_h.merge(severity: -1, group: true), opts)
|
114
|
+
end
|
118
115
|
|
119
|
-
|
120
|
-
|
116
|
+
def key
|
117
|
+
self.regex # alias for testing convenience
|
118
|
+
end
|
121
119
|
end
|
122
|
-
end
|
123
120
|
end
|
124
121
|
end
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Logster
|
4
4
|
class IgnorePattern
|
5
|
-
|
6
5
|
def initialize(message_pattern = nil, env_patterns = nil)
|
7
6
|
@msg_match = message_pattern
|
8
7
|
@env_match = env_patterns
|
@@ -44,7 +43,7 @@ module Logster
|
|
44
43
|
else
|
45
44
|
false
|
46
45
|
end
|
47
|
-
|
46
|
+
else
|
48
47
|
false
|
49
48
|
end
|
50
49
|
end
|
data/lib/logster/logger.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "logger"
|
4
4
|
|
5
5
|
module Logster
|
6
6
|
class Logger < ::Logger
|
@@ -41,9 +41,7 @@ module Logster
|
|
41
41
|
logger.add(severity, message, progname, &block)
|
42
42
|
end
|
43
43
|
ensure
|
44
|
-
if logger.respond_to? :skip_store
|
45
|
-
logger.skip_store = old
|
46
|
-
end
|
44
|
+
logger.skip_store = old if logger.respond_to? :skip_store
|
47
45
|
end
|
48
46
|
|
49
47
|
def add(*args, &block)
|
@@ -55,15 +53,11 @@ module Logster
|
|
55
53
|
end
|
56
54
|
|
57
55
|
def add_with_opts(severity, message = nil, progname = progname(), opts = nil, &block)
|
58
|
-
if severity < level
|
59
|
-
return true
|
60
|
-
end
|
56
|
+
return true if severity < level
|
61
57
|
|
62
58
|
# it is not fun losing messages cause encoding is bad
|
63
59
|
# protect all messages by scrubbing if needed
|
64
|
-
if message && !message.valid_encoding?
|
65
|
-
message = message.scrub
|
66
|
-
end
|
60
|
+
message = message.scrub if message && !message.valid_encoding?
|
67
61
|
|
68
62
|
# we want to get the backtrace as early as possible so that logster's
|
69
63
|
# own methods don't show up as the first few frames in the backtrace
|
@@ -73,9 +67,7 @@ module Logster
|
|
73
67
|
backtrace ||= progname.backtrace if progname.kind_of?(::Exception)
|
74
68
|
if !backtrace
|
75
69
|
backtrace = caller_locations
|
76
|
-
while backtrace.first.path.end_with?("/logger.rb")
|
77
|
-
backtrace.shift
|
78
|
-
end
|
70
|
+
backtrace.shift while backtrace.first.path.end_with?("/logger.rb")
|
79
71
|
end
|
80
72
|
backtrace = backtrace.join("\n")
|
81
73
|
opts[:backtrace] = backtrace
|
@@ -90,12 +82,18 @@ module Logster
|
|
90
82
|
add_to_chained(@chained[i], severity, message, progname, opts, &block)
|
91
83
|
rescue => e
|
92
84
|
# don't blow up if STDERR is somehow closed
|
93
|
-
|
85
|
+
begin
|
86
|
+
STDERR.puts "Failed to report message to chained logger #{e}"
|
87
|
+
rescue StandardError
|
88
|
+
nil
|
89
|
+
end
|
94
90
|
end
|
95
91
|
i += 1
|
96
92
|
end
|
97
93
|
end
|
98
94
|
|
95
|
+
return if @skip_store
|
96
|
+
|
99
97
|
progname ||= @progname
|
100
98
|
if message.nil?
|
101
99
|
if block_given?
|
@@ -106,7 +104,7 @@ module Logster
|
|
106
104
|
end
|
107
105
|
end
|
108
106
|
|
109
|
-
|
107
|
+
message = formatter.call(severity, Time.now, progname, message) if formatter
|
110
108
|
|
111
109
|
opts ||= {}
|
112
110
|
opts[:env] ||= Thread.current[LOGSTER_ENV]
|
@@ -114,7 +112,11 @@ module Logster
|
|
114
112
|
report_to_store(severity, progname, message, opts)
|
115
113
|
rescue => e
|
116
114
|
# don't blow up if STDERR is somehow closed
|
117
|
-
|
115
|
+
begin
|
116
|
+
STDERR.puts "Failed to report error: #{e} #{severity} #{message} #{progname}"
|
117
|
+
rescue StandardError
|
118
|
+
nil
|
119
|
+
end
|
118
120
|
end
|
119
121
|
|
120
122
|
private
|