Skip to content

Support for logging libraries other than Logback #1

@iljakorneckis

Description

@iljakorneckis

I tried using this library in my project at work. Alas, the project uses Log4j as the logging library - which leads to an exception in the constructor of the LogRecorder (a NoClassDefFound in case of the test project attached below):

public LogRecorder(Class<?> type) {
    this.logger = (Logger) LoggerFactory.getLogger(type);
}

I tried changing the Logger type from the Logback (ch.qos.logback.classic.Logger) one to the SLF4J interface (org.slf4j.Logger), but that doesn't have the addAppender method :/

Since this could be quite an undertaking, I suggest adding to the Readme that only Logback is supported for now, to avoid confusion.

I have attached an example project that uses Log4j2 below.
Log4j2Project.zip

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions