Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jersey Logging filter cuts entity #3281

Closed
jerseyrobot opened this issue Nov 25, 2015 · 7 comments
Closed

Jersey Logging filter cuts entity #3281

jerseyrobot opened this issue Nov 25, 2015 · 7 comments

Comments

@jerseyrobot
Copy link
Contributor

I need to log the whole entity with Jersey's LoggingFilter. Therefore I set maxEntitySize to 65536 (64kB):

restclient.register(new LoggingFilter(myLogger, 64*1024));

But the logged result is always cutted after 8752 bytes. (There is no "...more..." appended.)

Environment

All

Affected Versions

[2.22.1]

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Reported by tkn777

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Sub-Tasks:
JERSEY-3034

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
@pavelbucek said:
Can you please provide reproducer?

I see that 8 kB is default value of maxEntitySize, so there might be some issue with the "setting" of this value.

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Marked as incomplete on Monday, December 7th 2015, 5:11:47 am

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
tkn777 said:
It seems to be a HTTPS problem. The problem only occurs, if the resource is accessed through HTTPS!

Here is a Java example class. If you set the 'uri' to some entity resource, larger than 8kb, you can see, that it gets not logged completely using the LoggingFilter.

**RestLoggingTestClient.java**import java.util.logging.Logger;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;

import org.glassfish.jersey.filter.LoggingFilter;

public abstract class RestLoggingTestClient {

	public static void main(String[] args) {
		Client restClient = ClientBuilder.newBuilder().build();
		String uri = "https://path-to-file-larger-than-8kb"; 		WebTarget target = restClient.target(uri);
		target.register(new LoggingFilter(Logger.getLogger(RestLoggingTestClient.class.getName()), 64 * 1024));
		Invocation.Builder requestBuilder = target.request();
		requestBuilder.get();
	}
}

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JERSEY-3009

@jerseyrobot
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant