-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Print full exception when console is non-interactive #88297
Print full exception when console is non-interactive #88297
Conversation
The console logger truncates stack traces so a user is not bombarded with enormouse messages on startup. However, when the output is redirected to a file, there is no need to avoid large messages, and in fact it is a hinderance to debugging. This commit adds an internal flag to the console logging exception convert which disables the truncation when attached to a non-interactive console.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @rjernst, I've created a changelog YAML for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
*/ | ||
@Plugin(name = "consoleException", category = PatternConverter.CATEGORY) | ||
@ConverterKeys({ "consoleException" }) | ||
public class ConsoleThrowablePatternConverter extends ThrowablePatternConverter { | ||
private ConsoleThrowablePatternConverter(String[] options, Configuration config) { | ||
|
||
// true if exceptions shoudwhether exception formatting should always be delegated to the super class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: text in comment.
} | ||
|
||
@Override | ||
public void format(final LogEvent event, final StringBuilder toAppendTo) { | ||
Throwable error = event.getThrown(); | ||
if (error == null) { | ||
if (enabled == false | error == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjernst did you mean to use a bitwise OR here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not! I opened #88310
The console logger truncates stack traces so a user is not bombarded
with enormouse messages on startup. However, when the output is
redirected to a file, there is no need to avoid large messages, and in
fact it is a hinderance to debugging. This commit adds an internal flag
to the console logging exception convert which disables the truncation
when attached to a non-interactive console.