The Lambda function handler is the method in your function code that processes events. When your function is invoked, Lambda runs the handler method. Your function runs until the handler returns a response, exits, or times out. The following example function logs the contents of the event object and returns the location of the logs. This page shows examples of both CommonJS and ES module handlers.