I\'m looking for a way to log JSON posts in a RESTEASY framework.
I woul like to log the POST body to log file to see what the client is sending to me.
Is t
As supplement of excellent answer of lefloh, I suggest replace:
!MediaType.APPLICATION_JSON_TYPE.equals(requestContext.getMediaType())
with
!MediaType.APPLICATION_JSON_TYPE.isCompatible(requestContext.getMediaType())
equals method takes into account parameters of media type, eg. charset=UTF-8, and does not work in some scenarios according to intention of lefloh. isCompatible compares only type and subtype of media type and is more suitable in this case.
PS. I know, this post should be placed as comment, but I have no enough level of reputation to do it. I also edited lefloh answer but some php and ios guys rejected it.