Recoverable error logged at ERROR level

Asked by Lin Hua Cheng

In the error handling of horizon, recoverable error is logged at ERROR LEVEL.

    if issubclass(exc_type, RECOVERABLE):
        wrap = True
        if not force_silence and not handled and (not ignore or force_log):
            log_method(error_color("Recoverable error: %s" % exc_value))
        if not ignore and not handled:
            messages.error(request, message or exc_value)
        if redirect:
            raise Http302(redirect)
        if not escalate:
            return RecoverableError # return to normal code flow

Recoverable exceptions are typically application exception or validation error that the user can fix.

Should this be logged as warning or info instead?

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Dashboard (Horizon) Edit question
Assignee:
No assignee Edit question
Solved by:
Gabriel Hurley
Solved:
Last query:
Last reply:
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) said :
#1

Logging recoverable error as ERROR in the log might cause false alarm if there are log file monitoring is in place that looks for ERRORs.

Revision history for this message
Best Gabriel Hurley (gabriel-hurley) said :
#2

I could get behind logging it as a WARN. A real ERROR message was (hopefully) logged on the other end of the API where the problem originated. From Horizon's perspective it's a problem, but we can recover so a full-blown ERROR isn't required.

Revision history for this message
Lin Hua Cheng (lin-hua-cheng) said :
#3

Thanks Gabriel Hurley, that solved my question.