Easy API Gateway/Lambda “Serverless” API Logging/Debugging

Developing and testing “serverless” APIs using Amazon API Gateway and AWS Lambda can be made much easier with built-in support for CloudWatch Logs.

In Lambda functions you can use log statements to send log events to CloudWatch Log streams, and API Gateway automatically submits log events for requests to APIs with logging enabled.

However, it can be difficult to reconcile log events for a serverless API sent across multiple CloudWatch log groups and log streams. Tracking down logs for a specific request or tailing request logs for a serverless API can be a cumbersome experience.

To help improve the serverless dev/debug/test experience, I’ve released a fork of the excellent awslogs project to include native support for API Gateway/Lambda serverless APIs. Given an API Gateway REST API ID and Stage name, this tool produces an aggregated stream of time-ordered*, color-coded log events emitted by API Gateway and all Lambda functions attached to your API. The log events can then be further filtered and processed by standard command-line tools.

i.e. stream all log events emitted from API Gateway as well as from all Lambda functions attached to the API:

apilogs get --api-id xyz123 --stage prod --watch

or search APIG/Lambda logs for events from a specific request ID in the past hour:

apilogs get --api-id xyz123 --stage prod --start='1h ago' | grep "6605b081-6f04-11e6-97ac-c34deb0b3dd9"

Tip: To correlate API Gateway request IDs with Lambda invocations, send $context.requestId to your Lambda function via a mapping template and include it in your Lambda log messages (i.e. console.log(event.apiRequestId + ” – log message”);)

Check out ‘apilogs’ here. Fixes and contributions are greatly appreciated.

Happy debugging!

Write a Comment



  • chubby gay mens dating sites

    gay dating a macho

  • dos chicos se conocieron en un chat gay

    gay men chat cam

  • chat gay free

    chat with gay men

  • gay men vs women dating as a bi man

    triad gay dating sites

  • free asian chat lines gay

    free gay bi chat lines in seattle wa

  • best gay dating sites for southwest florida

    gay men dating sites missouri

  • gay teen dating

    gay black dating apps for fat black gay men

  • gay bear dating

    gay trucker dating

  • dating a bipilar gay guy

    steve cardenas dating gay

  • older gay dating app

    gay mature daddy dating site

  • gay christian dating

    dating guys when 18 gay

  • 3password


  • funny games biz sex

    truth or dare sex games 69

  • shota boys sex games

    free 3d adult sex games

  • write an expository essay

    write a persuasive essay

  • paid essay writing

    writing a descriptive essay

  • real online casino

    free no deposit casino

  • reflective essay on writing

    essay writing online

  • write my college essay

    help writing essays

  • writing a personal essay

    what to write an essay on

  • pay to write essay

    writing persuasive essay

  • argument essay writing

    writing an essay intro

  • over 40 gay dating site

    free gay dating in duluth mn

  • romeo gay dating

    gay dating website free

  • best gay dating sites canada

    anchorage gay dating

  • surge gay dating reddit

    gay dating games

  • gay dating sim site for android

    gay dating chicago

  • gay dating sites in india

    gay dating site

  • dating for gay daddies

    sa gay dating site

  • gay bear dating sites

    maleforce gay chat

  • keto diet dangerous

    keto friendly foods