Skip to content

Change logging level from fine to warn for exceptions #6499

@pkiraly

Description

@pkiraly

In several cases (33 matches in 20 files) the caught exceptions are logged with FINE level. E.g.:

try {
  passportValidatorMinLength = Integer.parseInt(_passportValidatorMinLength);
} catch (NumberFormatException nfe) {
  logger.fine("Invalid value for PwMinLength: " + _passportValidatorMinLength);
}

There are many informative notification in FINE level, which doesn't give you important information in case of something is not happenning as expected. Exceptions are more importants, since it catches some errors, so they should be distinguishable from these lowel level notifications. I suggest to change each log entries created by exception handling at least warn level.

[Suggestion:]

try {
  passportValidatorMinLength = Integer.parseInt(_passportValidatorMinLength);
} catch (NumberFormatException nfe) {
  logger.warning("Invalid value for PwMinLength: " + _passportValidatorMinLength);
}

The regex to catch the occurences: Exception .+? ?\) \{\n\s+logger\.fine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions