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

Is it possible to log the actual payload data instead of just the number of bytes? #105

Open
rossbrigoli opened this issue Sep 9, 2023 · 0 comments

Comments

@rossbrigoli
Copy link

The log entries emitted by LoggingPayloadProcessor only logs the number of bytes in of the payload data. It's not useful if the request data is JSON.

Example:

The value of the data field is data=86B.

{"instant":{"epochSecond":1694276873,"nanoOfSecond":586464093},"thread":"pool-4-thread-1","level":"INFO","loggerName":"com.ibm.watson.modelmesh.payload.LoggingPayloadProcessor","message":"Payload: Payload{id='69-1', modelId='with-logging', method='inference.GRPCInferenceService/ModelInfer', status=request, metadata=Metadata(content-type=application/grpc,user-agent=grpc-go/1.51.0,grpcgateway-user-agent=python-requests/2.31.0,authorization=Basic xxxx,grpcgateway-authorization=Basic xxxx,grpcgateway-accept=/,grpcgateway-content-type=application/json,x-forwarded-host=with-logging-wines.apps.fmflask2.faisallabs.net,x-forwarded-for=3.105.194.26, 10.131.2.48, ::1), data=63B}","endOfBatch":false,"loggerFqcn":"org.apache.logging.slf4j.Log4jLogger","contextMap":{},"threadId":45,"threadPriority":5}
{"instant":{"epochSecond":1694276873,"nanoOfSecond":586949553},"thread":"pool-4-thread-1","level":"INFO","loggerName":"com.ibm.watson.modelmesh.payload.LoggingPayloadProcessor","message":"Payload: Payload{id='69-1', modelId='with-logging', method='inference.GRPCInferenceService/ModelInfer', status=Status{code=OK, description=null, cause=null}, metadata=Metadata(grpc-encoding=identity,grpc-accept-encoding=gzip), data=86B}","endOfBatch":false,"loggerFqcn":"org.apache.logging.slf4j.Log4jLogger","contextMap":{},"threadId":45,"threadPriority":5}
Wouldn't it be useful if we log the actual payload data instead?

At line 108 of the Payload.java file, I think it will be more useful if we use ByteBuf.toString(charset) instead of .readallbytes(). Or at least allow an option to configure the payload serialization/deserialization options for payload logging.

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

No branches or pull requests

1 participant