Re: VS: VS: Log headers for failing request

Mark Thomas <[email protected]> Mon, 8 Jun 2026 10:22:21 +0100
Newsgroups gmane.comp.jakarta.tomcat.user
Message-ID <[email protected]>
On 08/06/2026 10:20, Harri Pesonen via users wrote:
>   -Dorg.apache.juli.logging.UserDataHelper.CONFIG=INFO_ALL
> 
> Does not log anything unless I change .level=ALL
> At least not in .level=INFO
> 
> I have Tomcat/9.0.117

It will log invalid requests.

Mark


> ________________________________
> Lähettäjä: Mark Thomas <[email protected]>
> Lähetetty: maanantai 8. kesäkuuta 2026 11.36
> Vastaanottaja: [email protected] <[email protected]>
> Aihe: Re: VS: Log headers for failing request
> 
> On 08/06/2026 09:09, Harri Pesonen via users wrote:
>> Thanks,
>>
>> org.apache.coyote.http11.Http11InputBuffer#fill
>>
>> is logging the URL and headers of every (succesful) request when I set .level = ALL on logging.properties (but this is not practical in production).
> 
> Why did you do that? That wasn't what I suggested you did.
> 
>> Hopefully it logs also when there is error.
> 
> It will log every request so you'll see the error as well.
> 
>> It would be nice to be able to log only those requests that result in 400 Bad Request for any reason,
>> when Tomcat rejects the HTTP request so that it does not go to application at all.
>> Log level should be SEVERE (ERROR) or WARNING in these cases, so that normal log level does not need to be changed.
> 
> By default, we aim not to have bad user input trigger any logging at
> all. If you follow my previous advice, you should get the information
> you need (at INFO level).
> 
> Mark
> 
> 
>> ________________________________
>> Lähettäjä: Mark Thomas <[email protected]>
>> Lähetetty: perjantai 5. kesäkuuta 2026 18.22
>> Vastaanottaja: [email protected] <[email protected]>
>> Aihe: Re: Log headers for failing request
>>
>> On 05/06/2026 13:56, Harri Pesonen via users wrote:
>>> How to log HTTP headers for POST request that fails with 400 Bad Request so that the request does not go to application at all?
>>> It can be seen in access log only.
>>> I would like to see the headers or the full request.
>>> I suspect that client sends content-type somehow incorrectly.
>>> There is nothing in catalina log.
>>
>> Tomcat version?
>>
>> HTTP version?
>>
>> Try adding
>>
>> -Dorg.apache.juli.logging.UserDataHelper.CONFIG=INFO_ALL
>>
>> to JAVA_OPTS.
>>
>> Mark
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
>