reportportal/agent-java-karate

Want to show logs in report portal based on log level (WARN, INFO, DEBUG)

shubham18-code opened this issue · 2 comments

Have karate tests integration with report portal setup. Trying to show logs in report portal based on logging configuration level [ fatal>error>warn>info>debug>trace ], but it's not working. It is showing INFO level log under DEBUG section. As per my understanding INFO logs should not logged in DEBUG in report portal, but it showing at wrong place.

Hare is snapshot.
D point to DEBUG log and I pointing to INFO log, Why this INFO logs showing under DEBUG ? Log slider in report portal pointing to INFO in snapshot.
Screenshot (119)

I am using following log4j2.xml

<?xml version="1.0" encoding="UTF-8"?>
<Configuration packages="com.epam.ta.reportportal.log4j.appender" status="WARN">
    <Appenders>
        <Console name="ConsoleAppender" target="SYSTEM_OUT">
            <PatternLayout
                    pattern="%d [%t] %-5level %logger{36} - %msg%n%throwable"/>
        </Console>
        <ReportPortalLog4j2Appender name="ReportPortalAppender">
            <PatternLayout
                    pattern="%d [%t] %-5level %logger{36} - %msg%n%throwable"/>
        </ReportPortalLog4j2Appender>
    </Appenders>
    <Loggers>
        <Root level="DEBUG">
            <AppenderRef ref="ConsoleAppender"/>
            <AppenderRef ref="ReportPortalAppender"/>
        </Root>
        <Logger name="com.epam.reportportal.service" level="WARN" additivity="false">
            <AppenderRef ref="ConsoleAppender"/>
            <AppenderRef ref="ReportPortalAppender"/>
        </Logger>
        <Logger name="com.epam.reportportal.utils" level="WARN" additivity="false">
            <AppenderRef ref="ConsoleAppender"/>
            <AppenderRef ref="ReportPortalAppender"/>
        </Logger>
    </Loggers>
</Configuration>

pom.xml

   <repositories>
		<repository>
			<id>bintray</id>
			<url>http://dl.bintray.com/epam/reportportal</url>
		</repository>
		<repository>
			<id>jitpack.io</id>
			<url>https://jitpack.io</url>
		</repository>
	</repositories>
           
<dependencies>
        <dependency>
            <groupId>com.epam.reportportal</groupId>
            <artifactId>agent-java-cucumber</artifactId>
            <version>5.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.epam.reportportal</groupId>
            <artifactId>commons-model</artifactId>
            <version>5.2.2</version>
        </dependency>
        <dependency>
            <groupId>com.epam.reportportal</groupId>
            <artifactId>client-java</artifactId>
            <version>5.0.21</version>
        </dependency>
    <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-gatling</artifactId>
            <version>0.9.6</version>
        </dependency>
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-apache</artifactId>
            <version>0.9.6</version>
        </dependency>
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-junit5</artifactId>
            <version>0.9.6</version>
        </dependency>
</dependencies>

I am referring sendLog() methods from https://github.com/workwithprashant/karate-reportportal-demo/blob/develop/src/test/java/com/dell/reporting/reportportal/ScenarioReporter.java

Please suggest any solution for the consolidating logs in report portal as per provided log level.

Thanks,
Shubham

I tried with logback.xml ( logger-java-logback ) as well but RP is not showing log correctly. It showing DEBUG logs under INFO section, Why this is happens ?

Please use the latest official Agent version and setup logging according to documentation to address the issue:
https://github.com/reportportal/agent-java-karate/releases/tag/5.0.0
https://github.com/reportportal/agent-java-karate/blob/develop/README.md