Skip to content

Consider upgrading log4j2 to 2.12.1 #45523

@astefan

Description

@astefan

There are two recent updates to log4j2 code:

which improved the logging for log4j in case a file cannot be accessed while traversing a directory. Case in question relevant for Elasticsearch: a rollover strategy with a Delete action for files that are older than X period of time. If one of the files checked cannot, for whatever reason (a valid use case for this is a non-default logs folder used also by other processes/applications to handle other files), be accessed a java.nio.file.AccessDeniedException is being thrown.

In the version ES is using atm - 2.11.1 - the exception above would have been caught by this try {} catch {} which, in turn, would have been handled by this block of code which is empty. The exception is basically swallowed without any logging whatsoever.
An Elasticsearch user would have noticed that the log files are accumulating, not being deleted as it should and, at the same time, not having a clue why this was like this.

Fortunately, the recent commits referenced above went into 2.12.1 version and now the AccessDeniedException (or any other exception thrown while traversing the list of files) is being logged.

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