SOS
SOS copied to clipboard
Don't throw exceptions for invalid requests
This may not be feasible, but seems worth a discussion.
Currently we throw OwsExceptions when invalid requests are made to the SOS. These often constitute the majority of the SOS log, and make it difficult to differentiate between a misbehaving client and real errors in the SOS (especially because ease OwsException comes with a long stack trace).
Could we log invalid requests in a separate log file, preferably without the stack trace? Or at least remove the stack trace in the main log for invalid requests? It would probably require that we catch the OwsException at some point, log it, and construct a non-exception error response...
The used logging framework logback provides some filter functionality. Maybe with this it is possible to write the invalid request log statements into a separate log file. Invalid XML request contain the string [XmlBeans validation error:] which can be used for filtering.
+1 for splitting up the log files. I would also include the requests that are invalid because of their content (non-existing parameter constellation etc.).
:+1:
We need to reduce the noise in the logs. Everything regarding bad requests and other OwsException should be printed as one-line log giving the wrong parameter and it's value WITHOUT the exception stack trace.