13 ms·
> Monitor your infrastructure and set up alerts [..] "fatal" OR "exception" OR "error" I almost have the regex "fatal|invalid|unknown|error|except|critical|can
by daniel_iversen 7y ago
> Monitor your infrastructure and set up alerts [..] "fatal" OR "exception" OR "error"
I almost have the regex "fatal|invalid|unknown|error|except|critical|cannot" in muscle memory many years after having last had to type it - must have typed it thousands of times tailing and grepping logs :- )
- dTal 7y agoThat's a smell. If you have to type a mouthful like that more than twice, put it in a script.
- unoti 7y agoInstead of having a Regex that searches for error|critical|except it’s a good thing to have a log level in your logging infrastructure, so that you can query for example log level=2 and get all the bad things. It takes a bit to work this into the code and infrastructure everywhere but it’s worth it.
- cutler 7y agoIn Ruby: %w[fatal invalid unknown error except critical cannot].any? {|word| 'My critical error message'.include? word} ... may be better than a regex if it's just a list of literal strings. Javascript also has something similar.
- xxpor 7y agowatch out for someone writing [FATAL] in a form somewhere and it getting logged :)