eclipse-ee4j / eclipse-ee4j/jersey
LoggingFilter always truncates if message size is larger than 4096
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
Related code in LoggingFilter.java:
```
private InputStream logInboundEntity(final StringBuilder b, InputStream stream, final Charset charset) throws IOException {
if (!stream.markSupported())
{ stream = new BufferedInputStream(stream); }
stream.mark(maxEntitySize + 1);
final byte[] entity = new byte[maxEntitySize + 1];
final int entitySize = stream.read(entity);
b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize), charset));
if (entitySize > maxEntitySize)
{ b.append("...more..."); }
b.append('\n');
stream.reset();
return stream;
}
```
The stream.read(entity) reads maximum of 8192 bytes in one go (entitySize will be maximum 4096) even if the entity array size is much more larger, therefore the logging output is truncated.
Contributor guide
Assessment
This issue has not been assessed yet.