slfj4 logger not included from project
SiKing opened this issue · 6 comments
When generating the Serenity report, I see:
[INFO] --- serenity-maven-plugin:2.0.56:aggregate (default) @ XYZ-integrationtests ---
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
My pom already has
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>runtime</scope>
</dependency>
Do I need to declare this dependency again for the plugin? I do not have to declare any logger for any other plugin.
I'm not sure, it might be something to do with the scope.
I do not think I (as an end-user) should need to do anything to get the logging to work. The plugin should be a self-contained unit?
At least that is how all other Maven plugins work. Regardless of what logger I declare in my pom - even if I declare none - all other plugins log out messages. The serenity-maven-plugin only dumps out the message as above.
Not exactly. You need to say what sort of logging you want - it is never configured in the libraries (otherwise each library would do its own thing and the logs would be chaotic). See https://www.slf4j.org.
That is correct for libraries. However, plugins are not libraries - they are never linked to your code.
This sound's like a fair point; could you propose a PR?
OK, I figured it out.
TL;DR: user error, not a bug!
According to documentation Maven handles all this stuff for you. So I had to coax our Jenkins to show me where it thinks ${maven.home} is, and then I looked in there. Bunch of things were missing, one of which was the simplelogger.properties.
Sorry to have bothered you. Have a good weekend. ;)