Simple use of 'tail' and 'grep'. Multiple conditions

Try:

tail -f log.txt | egrep 'WARN|ERROR'

In addition to switching to egrep/grep -E to get the alternation operator of extended regular expressions, you can you can also use multiple -e arguments to regular grep or even fgrep/grep -F

In fact, if your searches are all static strings (like the original question), you can even ‘downgrade’ all the way to fgrep/grep -F which might give a speed boost (since it always does direct string comparisons without regexps).

fgrep -e DEBUG -e INFO -e WARN -e ERROR -e FATAL

Also POSIX allows patterns to be separated by newlines.

# bash-ish to put a newlines into the string
fgrep $'DEBUG\nINFO\nWARN\nERROR\nFATAL'

# Standard syntax, but easier to break while editing(?):
fgrep "$(for f in DEBUG INFO WARN ERROR FATAL; do echo "$f"; done)"