News for hackers. Stuff that matters.
Re:Ask HN: How do you make sure your servers are up as a sin... by daniel_iversen on Wednesday November 06, 2019 @06:12PM (#21468613)
> 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 :- )

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.
Re:Ask HN: How do you make sure your servers are up as a sin... by xxpor on Wednesday November 06, 2019 @08:25PM (#21469547)
watch out for someone writing [FATAL] in a form somewhere and it getting logged :)
Re:Ask HN: How do you make sure your servers are up as a sin... by dTal on Thursday November 07, 2019 @05:14AM (#21471922)
That's a smell. If you have to type a mouthful like that more than twice, put it in a script.