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

Skip loading of jansi from log4j2 #20334

Merged
merged 1 commit into from
Sep 6, 2016
Merged

Skip loading of jansi from log4j2 #20334

merged 1 commit into from
Sep 6, 2016

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Sep 6, 2016

Jython shades jansi into it's classpath without changing it's package or
anything like that. This causes attempts to load native code on windows which
blows up tests. This change adds log4j.skipJansi=true system property to our
tests as well as to the JVM properties we set.

@jasontedor can you take a look

Jython shades `jansi` into it's classpath without changing it's package or
anything like that. This causes attempts to load native code on windows which
blows up tests. This change adds `log4j.skipJansi=true` system property to our
tests as well as to the JVM properties we set.
@s1monw s1monw added >enhancement >test Issues or PRs that are addressing/adding tests review :Core/Infra/Logging Log management and logging utilities v5.0.0-beta1 labels Sep 6, 2016
@jasontedor
Copy link
Member

I was curious why this is only a problem on Windows. The relevant Log4j code has this:

if (!propsUtil.isOsWindows() || propsUtil.getBooleanProperty("log4j.skipJansi") || direct) {
    return outputStream;
}

and otherwise proceeds to try to load Jansi. Since this is only useful for console color support on Windows, and we will never supply the jar anyway, the change is good.

LGTM.

@jasontedor jasontedor merged commit 11f2da5 into elastic:master Sep 6, 2016
@jasontedor
Copy link
Member

Thanks for contributing to Elasticsearch @s1monw, I've merged this pull request. Keep them coming!

MaineC pushed a commit to MaineC/elasticsearch that referenced this pull request Sep 7, 2016
Jython shades `jansi` into it's classpath without changing it's package or
anything like that. This causes attempts to load native code on windows which
blows up tests. This change adds `log4j.skipJansi=true` system property to our
tests as well as to the JVM properties we set.
@jasontedor jasontedor mentioned this pull request May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Logging Log management and logging utilities >enhancement >test Issues or PRs that are addressing/adding tests v5.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants