When working with serverless functions such as Lambda, it is valuable to have portable, structured logs. In addition, you can combine the earlier recipes that dealt with logging with this recipe. The recipes that we covered in Chapter 4, Error Handling in Go, are just as relevant. Because we're using Apex to manage 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, for example, Amazon Kinesis or Elasticsearch.
Getting ready
Refer to the Getting ready section of the Go programming on Lambda with Apex recipe in this chapter.
How to do it...
These steps cover writing and running your application:
- From your Terminal or console application...