Hi All,
I'm working on a scenario where I receive PDF file from target systems. I'm receiving response as something like below.
reponse.content:
%PDF-1.7
%
1 0 obj
<</Type/Catalog/Pages 2 0 R/Lang(en-US) /StructTreeRoot 17 0 R/MarkInfo<</Marked true>>/Metadata 127 0 R/ViewerPreferences 128 0 R>>
endobj
2 0 obj
<</Type/Pages/Count 3/Kids[ 3 0 R 11 0 R 14 0 R] >>
.......
......
......
...... and so on.
Say Apigee X convert it as binary data by default and Now I want to log this response as is, using <CloudLogging> of MessageLogging policy. It's getting populated in APIGEE traces. But the log's are not visible in GCP's Log explorer. When it's json payloads, it's viewing absolutely fine.
Could u please help me with the PDF responses? Is there any setting that needs to be enabled? or is there a separate process to log PDF/Any other files?
Thanks,
Manoj Sai T.
Solved! Go to Solution.
What do you want to appear in the logs, when you log a pdf to Cloud Logging?
Cloud Logging, I think, accepts a JSON payload. Not a PDF payload.
What is the goal here?
If you want the entire PDF to appear in cloud logging, you possibly could encode it (base64) and then wrapthat in the right JSON wrapper. But I think this solution is probably not a very good one, because PDFs can be QUITE LARGE and there is a size limit to the Cloud Logging log record. From my reading of the documentation, the limit is 256kb.
So what is your goal? Why do you want to log PDF files? What will the log records be used for?
GREAT, sounds good.