-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Property log4j.skipJansi should have a default of true #29
Conversation
The current default forces Win platforms to install an obscure jansi native library (for pretty print console messages) or always set this property to true, even for trivial unit tests.
Andy, this pull request has not gotten the attention it deserves. The change itself is trivial but more importantly the community should be okay with it. |
Wait a sec, that does not make sense to me. If I do have Jansi on my classpath, you're suggesting that I also have to have this system property set to true? That sounds pretty cumbersome and a step backwards. |
it suggest not to require the jansi - as if you don't have it (on windows system) it dies horribly, just because it's not able to format output |
I'm looking at ConsoleAppender right now, and I see that if the class is not installed, it still returns the proper OutputStream instead of blowing up. Is there a bug elsewhere? |
@jcetkov Can you give more details on how it "dies horribly"? What does the configuration look like? |
@mikaelstaldal I'm not able to reproduce as I'm not running windows - I've seen it in stacktrace from another user where the (TomEE) startup died with the following error
|
Jansi requires native code? That sucks. That means that Jansi can only be loaded by a single class loader and has to be in Tomcat's classpath. Given that, Jansi should default to being disabled. |
It would quite strange to have a property with name "skipXXX" with default value true. And it would also not be a very good idea to change default value of an existing property. If we want Jansi to be disabled by default, I would suggest that we rather add another property "enableJansi" with default false. While at it, since this is only used by the ConsoleAppender, maybe it would be better to have it as a parameter to ConsoleAppender in configuration, rather than a system property? |
What if we wanted to use JAnsi with the status logger?
Gary
…On Wed, Aug 16, 2017 at 1:44 PM, Mikael Ståldal ***@***.***> wrote:
It would quite strange to have a property with name "skipXXX" with default
value true. And it would also not be a very good idea to change default
value of an existing property.
If we want Jansi to be disabled by default, I would suggest that we rather
add another property "enableJansi" with default false.
While at it, since this is only used by the ConsoleAppender, maybe it
would be better to have it as a parameter to ConsoleAppender in
configuration, rather than a system property?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABIfN0afO2NLkauxosRI2E1xzvlku_Isks5sY0aIgaJpZM4IhcOF>
.
|
@garydgregory OK, maybe keep it as system property then. BTW, is there a way to safely try to load it on Windows, and gracefully do without it if the native library is missing (but the Java library is there)? |
Gary Gregory on dev@logging.apache.org replies: Gary |
@mikaelstaldal We have to change the default value as it can cause application startup to fail. |
Sure, I was just looking ahead... ;-) |
Remko Popma on dev@logging.apache.org replies: No problem changing the default behaviour to not using Jansi. Do we still retain the current system property with its current semantics |
If should add a parameter to ConsoleAppender, I think it should be named "enableJansi" (or similar) and have default false. |
I just stopped using the library, so I'll close this and let a dev decide. |
FYI: work on this is now in progress under JIRA ticket https://issues.apache.org/jira/browse/LOG4J2-2087 |
Merged into master. |
The current default forces Win platforms to install an obscure jansi
native library (for pretty print console messages) or always set this
property to true, even for trivial unit tests.