Regardless of its flexibility, FluentLogger doesn't provide an API
to create a logger with predefined name, which is possible with slf4j,
for example:
Logger logger = LoggerFactory.getLogger("my_logger_name");
This is used for example in the replication plugin, and the GC logger,
which both create a named log and set up a specific appender that
uses it. It is also possible that there are other plugins that need
to make use of it during migration to Flogger. For example, CollabNet
has an internal plugin that would need it.
A proposal to add such an API [1] was not accepted, with suggestion for
a more advanced solution. Since it's unlikely that this will happen soon,
we add a simple solution that can be used within core Gerrit and its
plugins:
NamedFluentLogger logger = NamedFluentLogger.forName("my_logger_name");
In the long term, after a suitable API is added in FluentLogger, we can
remove this.
[1] https://github.com/google/flogger/pull/138
Change-Id: Ieb914961bc1133d74684ecc39cae86c2e693daf9