Is there any way to print what values going in that object?
You need to write your own method to extract the relevant components of the request objects (using the public getters), appropriately format them, and return the lot as a string. Then call that method on the request
object, and pass the resulting string to the logger instead of the request
object.
If you need to delve into the private state (using abstraction-smashing reflection), that is more difficult, and you risk having your code break if the implementation details of the request class change.
Tedious. But there isn't a general solution, AFAIK.
(If you use a generic serialization scheme, you are liable to run against the problem that some of the components are either not relevant, or nor serializable, or huge ...)
UPDATE - Actually, it would be advisable to use your custom method like this:
if (log.isInfoEnabled()) {
log.info("Sending request: {}", myFormat(request));
}
If you don't guard the info(...)
call, the overhead of formatting will be incurred irrespective of the loggin level.