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

Ship a logging implementation #41

Closed
ctrueden opened this issue Jun 5, 2019 · 7 comments
Closed

Ship a logging implementation #41

ctrueden opened this issue Jun 5, 2019 · 7 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ctrueden
Copy link
Member

ctrueden commented Jun 5, 2019

PyImageJ does not currently ship a log4j implementation, which results in an obnoxious warning at startup:

log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

We can fix it by making imagej.init() include a log4j implementation on the classpath.

@ctrueden
Copy link
Member Author

ctrueden commented Nov 1, 2019

I tried with log4j-over-slf4j, and with logback-classic, but neither one on the runtime classpath clears up the warning. So further investigation is needed to understand more deeply what's going on here.

@ctrueden ctrueden added this to the unscheduled milestone Dec 2, 2019
@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/pyimagej-error-when-initializing/48765/3

@ctrueden ctrueden modified the milestones: unscheduled, paper Feb 1, 2022
@ctrueden
Copy link
Member Author

ctrueden commented Feb 1, 2022

Don't want to use log4j anymore, due to all the community hysteria—ahem security concerns. But still need to figure out this warning.

@ctrueden
Copy link
Member Author

ctrueden commented Feb 18, 2022

I didn't fix this bug yet. But I did fix the adjacent illegal reflection access warnings, as of 135bbf9, supported by scyjava's new jvm_version function present as of scijava/scyjava@73d758e.

@ctrueden
Copy link
Member Author

ctrueden commented Feb 19, 2022

The key to fixing this bug will be to use version 2.4.0 or later of ImageJ2, which is not yet released. We have already purged the log4j dependencies from the dependency tree—we just need to validate the current pom-scijava BOM using the melting pot, fix any problems, release pom-scijava 32.0.0, with net.imagej:imagej and sc.fiji:fiji preemptively bumped, and then cut those releases as well. At that point, log4j will no longer be in the mix, so these messages should disappear. See also scijava/pom-scijava#179.

@ctrueden ctrueden added the blocked Can't work on this issue until something changes elsewhere label Apr 20, 2022
@ctrueden ctrueden modified the milestones: paper, m1 Apr 20, 2022
@ctrueden
Copy link
Member Author

As soon as we have an ImageJ2 v2.4.0, we should update this repository across the board to recommend using it. Then this issue can be closed, assuming the log4j warnings are indeed gone.

@ctrueden
Copy link
Member Author

ctrueden commented Oct 31, 2022

As soon as we have an ImageJ2 v2.4.0, we should update this repository across the board to recommend using it. Then this issue can be closed, assuming the log4j warnings are indeed gone.

This log4j warnings were indeed fixed by ImageJ2 2.4.0. But then there are different but related warnings:

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.

We can fix it by making imagej.init() include a log4jSLF4J implementation on the classpath.

Earlier this month, I thoroughly researched how to deal with this annoying issue once and for all. I made a spreadsheet with details. We decided the correct solution for PyImageJ is ensure that scijava-config is always on PyImageJ's classpath: 1261e31.

Relatedly:

@ctrueden ctrueden removed the blocked Can't work on this issue until something changes elsewhere label Oct 31, 2022
@ctrueden ctrueden modified the milestones: m1, 1.3.0 Oct 31, 2022
jschneidereit pushed a commit to jschneidereit/pyimagej that referenced this issue Jul 20, 2024
Remove Python3.10 exclusion on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants