Logging
Tracking exceptions and problems within your application is critical; however, there will inevitably be cases where you wish you had more insight into the state of your application when a problem occurs. For this task, you will need to set yourself up with a good logging strategy. Log messages are a tool we have used for a very long time - and still use often. Very often, log messages are sent to files on disk and then shipped off to a log aggregator. Since we don't have access to these same types of logging system in a serverless architecture, we'll need to come up with something new.
AWS Lambda functions and other FaaS providers offer some mechanisms for keeping track ofstdout
andstderr
streams. In the case of Lambda, any print
statements or other error messages will end up in CloudWatch Logs. This delivery to CloudWatch happens automatically, and is especially useful as you'll always know where to go to check for errors or debugging statements. While this is a helpful feature, there...