Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't send logs to ReportPortal because com.epam.reportportal.service.LoggingContext.init is not called #13

Closed
RPMiller opened this issue Oct 4, 2018 · 5 comments
Assignees

Comments

@RPMiller
Copy link

RPMiller commented Oct 4, 2018

Not sure if this is the right place for the issue since it could be fixed in a few repos.

agent-java-junit does not set the logging context

The log4j2 appender gets invoked

https://github.com/reportportal/logger-java-log4j/blob/master/src/main/java/com/epam/ta/reportportal/log4j/appender/ReportPortalLog4j2Appender.java#L90

But then ignores the log because the logging context was never set.

https://github.com/reportportal/client-java/blob/master/src/main/java/com/epam/reportportal/service/ReportPortal.java#L146

I can send logs when using testNG because then logging context is set from

https://github.com/reportportal/agent-java-testNG/blob/master/src/main/java/com/epam/reportportal/testng/TestNGService.java#L109

then

https://github.com/reportportal/client-java/blob/bb58bb0f5ee1913fa7ba5f724d372eb1db9360fd/src/main/java/com/epam/reportportal/service/LaunchImpl.java#L197

I know almost nothing about this code base, but I'm curious as to why the testNG agent uses Launch and the junit agent uses ReportPortalService.

@DzmitryHumianiuk
Copy link
Member

@RPMiller TestNG adapter was done by team.
jUnit4 adapter was done by various contributors.

most probably junit should be updated.
BUT
at the moment, we do test new version of junit adapter, based on 3rd-party library, which utilize biteBuddy.

plz check it from v4 branch for this.

@DzmitryHumianiuk
Copy link
Member

@avarabyeu

I'm curious as to why the testNG agent uses Launch and the junit agent uses ReportPortalService.

@avarabyeu
Copy link
Member

@RPMiller hi. JUnit agent uses pretty old version of client-java dependency which is basically ReportPortal client.
Other frameworks (including TestNG) use fresh/latest client-java.
The main different between "old" and "new" ReportPortal client is that new version sends requests asynchronously and as the result, doesn't influence your test execution time so much as "old" version does

@DzmitryHumianiuk
Copy link
Member

@RPMiller
@sbabcoc does this update right now in v4 branch.
it will be switched to Launch service object

@sbabcoc
Copy link
Contributor

sbabcoc commented Oct 31, 2018

@RPMiller #19
This PR switches the back-end service connector from BatchedReportPortalService to Launch. This appears to resolve the logging context problem.

@filland filland closed this as completed Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants