Skip to content

Add a modifiable factory for SLF4J loggers #434

@freya022

Description

@freya022

I think it would be nice if we could set our own way to get a org.slf4j.Logger from the name, for example this could allow returning a fallback logger, when no logging implementation is detected, in this example I could use this method.

I assume this could be implemented by having a mutable property in KotlingLogging, which would get used by KLoggerFactory.logger.

This would also avoid checking the kotlin-logging-to-jul property for every logger, by checking once and using the right factory.

Caveats

This is modifiable by anyone, it could get overwritten by accident by an end user of a library that did set that property

Workarounds

Use your own function to get a KLogger

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions