# Using the Lambda context object to retrieve Java function information When Lambda runs your function, it passes a context object to the [handler](java-handler.md). This object provides methods and properties that provide information about the invocation, function, and execution environment. **Context methods** + `getRemainingTimeInMillis()` – Returns the number of milliseconds left before the execution times out. + `getFunctionName()` – Returns the name of the Lambda function. + `getFunctionVersion()` – Returns the [version](configuration-versions.md) of the function. + `getInvokedFunctionArn()` – Returns the Amazon Resource Name (ARN) that's used to invoke the function. Indicates if the invoker specified a version number or alias. + `getMemoryLimitInMB()` – Returns the amount of memory that's allocated for the function. + `getAwsRequestId()` – Returns the identifier of the invocation request. + `getLogGroupName()` – Returns the log group for the function. + `getLogStreamName()` – Returns the log stream for the function instance. + `getIdentity()` – (mobile apps) Returns information about the Amazon Cognito identity that authorized the request. + `getClientContext()` – (mobile apps) Returns the client context that's provided to Lambda by the client application. + `getLogger()` – Returns the [logger object](java-logging.md) for the function. The following example shows a function that uses the context object to access the Lambda logger. **Example [Handler.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; import [com.amazonaws.services.lambda.runtime.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java); import [com.amazonaws.services.lambda.runtime.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java); import [com.amazonaws.services.lambda.runtime.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java); import java.util.Map; // Handler value: example.Handler public class Handler implements RequestHandler