reportportal / agent-java-cucumber

Cucumber JVM version [1.0.0; 2.0.0) adapter
Apache License 2.0
26 stars 16 forks source link

No INFO log except dataTable log with agent-java-cucumber6 and logback #96

Closed ntthaibk closed 9 months ago

ntthaibk commented 11 months ago

I was trying to integrate reportportal to my workflow. And unfortunately, while report can be uploaded to reportportal, no INFO log got attached

Below is my configuration:

logback-spring.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <!-- Send debug messages to System.out -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!-- By default, encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} %-5level %logger{5} - %thread - %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="RP" class="com.epam.reportportal.logback.appender.ReportPortalAppender">
        <encoder>
            <!--Best practice: don't put time and logging level to the final message. Appender do this for you-->
            <pattern>%d{HH:mm:ss.SSS} [%t] %-5level - %msg%n</pattern>
            <pattern>[%t] - %msg%n</pattern>
        </encoder>
    </appender>

    <!--'additivity' flag is important! Without it logback will double-log log messages-->
    <logger name="binary_data_logger" level="TRACE" additivity="false">
        <appender-ref ref="RP"/>
    </logger>

    <logger name="com.epam.reportportal.service" level="WARN"/>
    <logger name="com.epam.reportportal.utils" level="WARN"/>

    <!-- By default, the level of the root level is set to DEBUG -->
    <root level="TRACE">
        <appender-ref ref="RP"/>
        <appender-ref ref="STDOUT"/>
    </root>

</configuration>

in gradle, I imported those 2 libs for report portal

testImplementation("com.epam.reportportal:agent-java-cucumber6:5.2.0")
testImplementation("com.epam.reportportal:logger-java-logback:5.1.6")

The result I got on report portal displayed as following

image

Those log should have couple of INFO and DEBUG log, but it turned out none, the log is displayed normally in STDOUT though.

Thank you for your help

HardNorth commented 9 months ago

@ntthaibk We use the same logging approach for every java agent we have, so I'm rather sure this is configuration issue. Please follow Logback's configuration guidelines to solve it: https://logback.qos.ch/manual/configuration.html

The first issue I see, there is no such name as logback-spring.xml in Logback's lookup logic, so I suggest you renaming it to logback-test.xml or logback.xml.