Skip to content

Commit

Permalink
Add basic trace debugging info
Browse files Browse the repository at this point in the history
  • Loading branch information
adamnfish committed Dec 20, 2023
1 parent bfc9903 commit 8c5e8d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ lazy val lambda = (project in file("lambda"))
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"com.amazonaws" % "aws-lambda-java-core" % "1.2.2",
"com.amazonaws" % "aws-lambda-java-events" % "3.11.1",
"com.amazonaws" % "aws-xray-recorder-sdk-core" % "2.15.0",
"software.amazon.awssdk" % "apigatewaymanagementapi" % awsJavaSdkVersion,
"software.amazon.awssdk" % "url-connection-client" % awsJavaSdkVersion,
) ++ commonDeps ++ loggingDeps,
Expand Down
2 changes: 2 additions & 0 deletions lambda/src/main/scala/io/adamnfish/pokerdot/Lambda.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.adamnfish.pokerdot

import com.amazonaws.services.lambda.runtime.events.{APIGatewayV2WebSocketEvent, APIGatewayV2WebSocketResponse}
import com.amazonaws.services.lambda.runtime.{Context => AwsContext}
import com.amazonaws.xray.AWSXRay
import com.typesafe.scalalogging.LazyLogging
import io.adamnfish.pokerdot.models.{AppContext, PlayerAddress}
import io.adamnfish.pokerdot.persistence.DynamoDbDatabase
Expand Down Expand Up @@ -65,6 +66,7 @@ class Lambda extends LazyLogging {
// Debugging
// logger.info(s"request body: ${event.getBody}")
// logger.info(s"connection ID: ${event.getRequestContext.getConnectionId}")
logger.info(s"Trace: ${AWSXRay.currentFormattedId()}")
logger.info(s"route: ${event.getRequestContext.getRouteKey}")

event.getRequestContext.getRouteKey match {
Expand Down

0 comments on commit 8c5e8d2

Please sign in to comment.