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

Consider change Log4j 2 to Logback because graalvm native build #7486

Closed
GrapeBaBa opened this issue Sep 6, 2023 · 7 comments
Closed

Consider change Log4j 2 to Logback because graalvm native build #7486

GrapeBaBa opened this issue Sep 6, 2023 · 7 comments

Comments

@GrapeBaBa
Copy link

We are working on https://github.com/optimism-java/hildr which is OP rollup client written in Java. For support p2p feature, we introduce teku as dependency, we used discV5 service discovery and libp2p gossip. It works well when compile with jar, however it not works with graalvm native build.

We found the issue is from Log4j 2 which still not support native build. The issue is here . Would we consider use logback as logging framework?

@rolfyone
Copy link
Contributor

rolfyone commented Sep 7, 2023

Hey thanks for raising.

I'm not sure we've really got time to switch libraries without some kind of major issue, there's quite a lot of plumbing involved in changing over.

Having said that, have you considered using the log4j api? there's a documented example
https://logging.apache.org/log4j/2.x/manual/api-separation.html#using-log4j2-api-with-logback
that looks promising?

I'll talk it over with the team and see what options we have...

@rolfyone
Copy link
Contributor

rolfyone commented Sep 8, 2023

Currently the main concern is existing log4j configuration, apart from the issue of changing. This may end up on the backlog because of that until we do more investigation.

In the mean time, let us know if you had any luck with referencing via api?

@GrapeBaBa
Copy link
Author

@rolfyone thanks, I am doing investigation, will feedback once I found the deep issues.

@GrapeBaBa GrapeBaBa reopened this Sep 12, 2023
@GrapeBaBa
Copy link
Author

Hey thanks for raising.

I'm not sure we've really got time to switch libraries without some kind of major issue, there's quite a lot of plumbing involved in changing over.

Having said that, have you considered using the log4j api? there's a documented example https://logging.apache.org/log4j/2.x/manual/api-separation.html#using-log4j2-api-with-logback that looks promising?

I'll talk it over with the team and see what options we have...

This is not works. But I found though no log print, it actual no impact for running. I post an issue with jvm-libp2p which may be the underlying problem we came across.

@StefanBratanov
Copy link
Contributor

Hi @GrapeBaBa have you tried the suggestion in micronaut-projects/micronaut-core#6041 to use log4j-over-slf4j dependency

@GrapeBaBa
Copy link
Author

Hi @GrapeBaBa have you tried the suggestion in micronaut-projects/micronaut-core#6041 to use log4j-over-slf4j dependency

Let me try it

@StefanBratanov
Copy link
Contributor

Closing this issue because of no activity. Will consider reopening if issue is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants