Description
When I use sam logs to view my lambda function logs from the console (OSX terminal) my log messages are mangled. Note, I don't expect them to be pretty printed, but the output below is mangled.
2019/08/22/[$LATEST]57ae4b1bd8bf448d8e674d8231cc1970 2019-08-22T08:08:49.231000 START RequestId: ce26f5df-b0d9-4347-882a-cd89ccfc8160 Version: $LATEST
"body": "SiteCode=TSTSTE0001&TransactionId=7e1ea8de-c4a8-4a4e-b7d1-9d29e191bc46&TransactionReference=ABC123&Amount=100.99&Status=Complete&Optional1=&Optional2=&Optional3=&Optional4=&Optional5=&CurrencyCode=ZAR&IsTes "body": "SiteCode=TSTSTE0001&TransactionId=7e1ea8de-c4a8-4a4e-b7d1-9d29e191bc46&TransactionReference=ABC123&Amount=100.99&Status=Complete&Optional1=&Optional2=&Optional3=&Optional4=&Optional5=&CurrencyCode=ZAR&IsTest=} } "awsRequestId": "ce26f5df-b0d9-4347-882a-cd89ccfc8160"090357:function:centbee-ozow-api-OzowCallback",a5af86f6fec0b2c15e5df12f5f4b98084bcb5b621032e88a08b962d3a98ac226f84f9b748e"
} } "Hash": "28f7ebe65d84d2737cada8bbe31bc314430d00fd0d4ca726efd523a5af86f6fec0b2c15e5df12f5f4b98084bcb5b621032e88a08b962d3a98ac226f84f9b748e"fc8160 DEBUG {
'28f7ebe65d84d2737cada8bbe31bc314430d00fd0d4ca726efd523a5af86f6fec0b2c15e5df12f5f4b98084bcb5b621032e88a08b962d3a98ac226f84f9b748e' }-cd89ccfc8160 ERROR { message: 'Ozow callback hash check failed',
2019/08/22/[$LATEST]57ae4b1bd8bf448d8e674d8231cc1970 2019-08-22T08:08:49.943000 2019-08-22T08:08:49.943Z ce26f5df-b0d9-4347-882a-cd89ccfc8160 ERROR Hash check failed
2019/08/22/[$LATEST]57ae4b1bd8bf448d8e674d8231cc1970 2019-08-22T08:08:49.983000 END RequestId: ce26f5df-b0d9-4347-882a-cd89ccfc8160
2019/08/22/[$LATEST]57ae4b1bd8bf448d8e674d8231cc1970 2019-08-22T08:08:49.983000 REPORT RequestId: ce26f5df-b0d9-4347-882a-cd89ccfc8160 Duration: 751.81 ms Billed Duration: 800 ms Memory Size: 128 MB Max Memory Used: 96 MB
Here is the view from CloudWatch Management Console:


Steps to reproduce
I am producing these log messages like this (Node 10.x):
console.debug(JSON.stringify({ ozowResponse }, null, 2));
Observed result
See description above.
Expected result
I printed four log messages. Two console.debugs and two console.errors. I expect to see these four log messages as in the sam logs output.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: OSX
sam --version: 0.17.0
Add --debug flag to command you are running
Description
When I use
sam logsto view my lambda function logs from the console (OSX terminal) my log messages are mangled. Note, I don't expect them to be pretty printed, but the output below is mangled.Here is the view from CloudWatch Management Console:
Steps to reproduce
I am producing these log messages like this (Node 10.x):
console.debug(JSON.stringify({ ozowResponse }, null, 2));Observed result
See description above.
Expected result
I printed four log messages. Two console.debugs and two console.errors. I expect to see these four log messages as in the
sam logsoutput.Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version: 0.17.0Add --debug flag to command you are running