eclipse-ee4j / eclipse-ee4j/jersey
JerseyInvocation is adding LOGGER.warning messages for every request with no way to suppress them
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
Some APIs (*cough* Github *cough*) require you to submit an Entity in the request body for verbs like DELETE. By default, Jersey throws exceptions if you try to do this. But if you configure the webtarget to allow it, you are now subject to log.warn messages for *every request*.
If I've configured my client to allow this, then I don't want to see a log message about it. The code in JerseyInvocvation.java currently says that the configuration is only to suppress *exceptions*, so in that case, it logs. For every request.
```
if (suppressExceptions) {
LOGGER.warning(LocalizationMessages.ERROR_HTTP_METHOD_ENTITY_NOT_NULL(method));
```
Long-term, I'll probably abandon Jersey for these requests, but it should probably change the code to either not log in this case or allow suppressing the warning logging.
Contributor guide
Research direction
Start in JerseyInvocation.java at the suppressExceptions branch shown in the issue, and trace how allowing an entity for DELETE and similar verbs affects logging and exceptions. Reproduce a configured WebTarget request with an entity, then verify that the intended behavior is clear: allowing the request should not emit a warning on every request while the exception behavior remains understood.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100