elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.19k stars 24.85k forks source link

Implement caching for Logger creation in ES Logging implementation #87511

Open pgomulka opened 2 years ago

pgomulka commented 2 years ago

Description

The ES Logging API's LogManager.getLogger is depending on LogManagerFactory implementation for logging creation LogManagerFactory is simply creating LoggerImpl - a simple adapter for log4j loggers. Log4j itself is caching logger creation.

ES logging API implementation should cache created logger adapters in LogManagerFactory.

LogManager.getLogger("name");
LogManager.getLogger("name");

should create only only one instance of LoggerImpl

a follow up after review https://github.com/elastic/elasticsearch/pull/86612/files/b8fb661f8576b0e690c22a4d813866f551a7e42d#r891688549

elasticmachine commented 2 years ago

Pinging @elastic/es-core-infra (Team:Core/Infra)