4 ms·
This is why stack traces exist. But I agree Java seems to not really have a culture of “make the error message helpful”, but instead preferring “make the error
by appplication 6mo ago
This is why stack traces exist. But I agree Java seems to not really have a culture of “make the error message helpful”, but instead preferring “make the error message minimal and factual”.
For what it’s worth, the rise of helpful error messages seems to be a relatively new phenomenon the last few years.
- Geezus_42 6mo agoA stack trace that is >10 pages in less is not what I would call minimal.
- deepsun 6mo agoAnd that's why you should have multiple appenders. So in code you write "log.error("...", exception)" once, but logging writes it in parallel to: 1. STDOUT for quick and easy look, short format. 2. File as JSON for node-local collectors. 3. Proper logging storage like VictoriaLogs/Traces for distributed logging. Each appender has its own format, some print only short messages, others full stacktraces for all causes (and with extra context information like trace id, customer id etc). I really think STDOUT-only logging is trying to squeeze different purposes into one unformatted stream. (And Go writing everything to STDERR was a really strange choice). https://www.baeldung.com/logback#bd-appenders https://www.baeldung.com/logback#bd-appenders
- Geezus_42 6mo agoCool. Convince your fellow Java developers to do that and I'll quit complaining about the awful errors every Java app produces.