Logger that stores messages, and flushes the last predefined number of last messages, when a predefined severity message arrives.