-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Error message: Log4j2 could not find a logging implementation #148
Comments
What build tool do you use? Did you get a build failure or an invalid signature on the MSI file ? |
I was running the CLI jar file with java through powershell, same context between the two versions. My build failed but sadly because of the complexity of the CI setup I don't have a lot of confidence except to say signing failed somehow and the only output was the above message about Log4j2. I wasn't so much needing to solve the MSI signage as reporting the "logging" error. I thought it might be low hanging fruit since jsign is otherwise able to write things to the console like "Adding authenticode signature to {xyz}" so maybe there would be an inconsistent use of the logger that might stick out. I'll try to poke at it a bit more on monday but it will be a non-trivial (potentially several hour to multi-day) project to get into a context with the credentials where I can try to repro it interactively, and (I hate to be that guy but) while I have other things that need attention the previous version is still working for me. If there were some kind of --verbose flag I could turn on that would help narrow where in the process the Log4j2 message is coming out, that would be relatively easy to add, but I don't see an option like that in the help. It would also not be too hard for me to just try previous versions and see which do and don't have this behavior. |
If you ran log4j is used by Apache POI when parsing the MSI file. But even if the warning is displayed a parsing error will still result in a exception visible on the console. |
I tried previous versions and the behavior is only on 4.1 and later (not 4.0).
Thank you for that. That is (essentially) how I'm running it. Edit: this was wrong
Is it expected to need to have log4j-core along with the jsign jar now? IE is jsign no longer meant to be a standalone jar fie? Atleast when signing MSIs? |
jsign.jar should contain everything needed, including log4j. That said, I just checked and you are right, the |
Ok I've got more of a handle on this now. First of all, I was wrong in my last reply, embarrassingly after about 30 test pipeline runs, the one that "worked" was because I ran the wrong branch. Setting classpath to that log4j jar did not help. This is probably not useful, but for posterity here are the results of a small subset of things I tried.
I was strucky by your referring to "the warning", and wasn't 100% if you were referring to the line about log4j, since it doesn't say "warning", and you seemed to be expecting it to continue past that (like one would expect with a warning) but what I was seeing was something that says "ERROR" and aborting my pipeline immediately. I finally managed to get into the build environment to experiment. First thing I did was run the command and it worked. It did show the log4j line, but continued on and signed the MSI (like it is a warning, just one that is logged at the ERROR level) Then I put the sign command into a In the past I have run into different versions of powershell reacting when I disabled So the issue, for me, was that this warning is being written at an ERROR level and written to stderr, and as soon as that text is returned to powershell it detects that as an error and aborts the script. |
Reopening to remind me that the log4j configuration isn't right yet. I don't understand why the |
I tried to upgrade from 3.1 to 4.2. My build script did well to sign several dlls, exes, and a ps1. When it got to signing an msi, something went wrong. But there was apparently a problem outputting the error message, as I got:
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
There was nothing before or after it.
It was before outputting anything like "Adding authenticode signature to..."
Reverting back to 3.1 made the problem go away.
The text was updated successfully, but these errors were encountered: