Re:Ask HN: How do you make sure your servers are up as a sin...
by unoti on Thursday November 07, 2019 @09:44AM
(#21473595)
Instead 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.
Re:Ask HN: How do you make sure your servers are up as a sin...
by cutler on Wednesday November 06, 2019 @09:40PM
(#21469900)
In 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.
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 :- )