perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.64k stars 1.56k forks source link

No logging of uncaught exception in user code #486

Closed MouettE-SC closed 7 years ago

MouettE-SC commented 8 years ago

Previous versions of spark would log uncaught exceptions in filter/routes especially when there is no exception handler but it doesn't log anything which makes it difficult to debug problems in user code during development. Based on what was done in 2.3 (adapted to the new codebase of 2.4) I will provide a small pull request to fix it.

MouettE-SC commented 8 years ago

I've created pull request #487 to resolve this.

edwardmp commented 8 years ago

Indeed this is very annoying and makes it hard to track down stuff. Hope this gets merged in soon.

tipsy commented 8 years ago

You can always add slf4j for it to behave like before:

 <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.13</version>
</dependency>
MouettE-SC commented 8 years ago

Adding slf4j-simple does not solve the issue. Firstly because I already use log4j for my project with its slf4j wrapper, it will conflict with the simple wrapper. Secondly because adding a wrapper won't make spark log the exception. In any case I tried to create an test project with a single route throwing an exception and slf4j-simple ; A 500 error is returned to the browser (expected) but except for startup message and favicon not found, nothing is logged in the console.

tipsy commented 8 years ago

You're correct, I was confusing this with the BYOL change we made earlier. Any reason not to merge this @perwendel ?

MouettE-SC commented 8 years ago

See #585 amd #679

hisham commented 8 years ago

+1