When working with serverless functions such as Lambda, it is valuable to have portable, structured logs. In addition, you can combine earlier recipes dealing with logging to this recipe. The recipes covered in Chapter 4, Error Handling in Go, are just as relevant. Because we're using Apex to handle our lambda functions, we chose to use the Apex logger for this recipe. We'll also rely on metrics provided by Apex as well as the AWS console. The earlier recipes explored more complex logging and metrics examples, and those still apply--the Apex logger can easily be configured to aggregate logs using something like Amazon Kinesis or Elasticsearch.
Apex serverless logging and metrics
Getting ready
Configure your environment...