Index of every page on this site: llms.txt
All skills
localstack avatar

/logs-analysis

@3526362
by localstacklocalstack/skills16 stars
Run it yourself

Analyze LocalStack logs and debug issues with lstk. Use when users need to view LocalStack logs, debug AWS API errors, troubleshoot Lambda functions, identify error patterns, or enable debug mode.

  • 1 file
  • 4 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/localstack/skills/logs-analysis

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈53 tokens for metadata: the name and description. ≈973 when used: this file.

Description uses 2.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈214 characters, or 2.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

LocalStack Logs Analysis

Analyze LocalStack logs to debug issues, identify errors, and understand AWS API interactions.

Capabilities

  • View and filter LocalStack logs
  • Identify error patterns and failures
  • Analyze AWS API request/response cycles
  • Track service-specific operations
  • Debug Lambda function executions

Prerequisites

  • The lstk CLI with a running emulator — see the localstack skill

Viewing Logs

Basic Log Commands

# Print available logs
lstk logs

# Follow logs in real time
lstk logs -f

# Last N lines
lstk logs -n 100

# Unfiltered output (lstk filters noise by default)
lstk logs -v

Reach for lstk logs -v whenever a log line you expect is missing — the default view drops low-signal output.

Filtering Logs

# Filter by service
lstk logs | grep -i s3
lstk logs | grep -i lambda
lstk logs | grep -i dynamodb

# Filter errors only
lstk logs | grep -i error
lstk logs | grep -i exception

# Filter by request ID (use -v so nothing is filtered out first)
lstk logs -v | grep "request-id-here"

Diagnostic Logs

lstk writes its own diagnostic log to lstk.log in the config directory — useful when the CLI itself misbehaves rather than the emulator:

lstk config path      # the lstk.log sits alongside this file

Debug Mode

lstk forwards host environment variables prefixed with LOCALSTACK_ into the emulator, so LocalStack config variables need that prefix:

# Start with debug mode
LOCALSTACK_DEBUG=1 lstk start

# Trace-level logging
LOCALSTACK_LS_LOG=trace lstk start

To make debug logging the default for a project, use an environment profile in config.toml:

[[containers]]
type = "aws"
env  = ["debug"]

[env.debug]
DEBUG = "1"

Keys inside an [env.*] profile do not need the LOCALSTACK_ prefix.

Analyzing API Requests

Request/Response Tracking

LocalStack logs include AWS API requests. Look for patterns like:

AWS <service>.<operation> => <status>

Example log entries:

AWS s3.CreateBucket => 200
AWS dynamodb.PutItem => 200
AWS lambda.Invoke => 200

Deployed Resources

lstk status lists the resources currently deployed in the emulator, which is often faster than grepping logs to answer "does this resource exist?":

lstk status
lstk --non-interactive status

Common Error Patterns

Error Possible Cause Solution
ResourceNotFoundException Resource doesn't exist Create the resource first; confirm with lstk status
AccessDeniedException IAM policy issue Check IAM enforcement mode
ValidationException Invalid parameters Verify request parameters
ServiceException Internal error Check LocalStack logs for details

Lambda Debugging

View Lambda Logs

# Lambda function logs appear in the emulator logs
lstk logs -v | grep -A 10 "Lambda"

# Or use CloudWatch Logs locally
lstk aws logs describe-log-groups
lstk aws logs get-log-events \
  --log-group-name /aws/lambda/my-function \
  --log-stream-name <stream-name>

Enable Lambda Debug Mode

LOCALSTACK_LAMBDA_DEBUG=1 lstk start

Health Check

# Check overall health
curl http://localhost:4566/_localstack/health | jq

# Check specific service
curl http://localhost:4566/_localstack/health | jq '.services.s3'

Troubleshooting Tips

  • No logs appearing: Ensure the emulator is running (lstk status)
  • Expected line missing: Re-run with lstk logs -v — the default view is filtered
  • Missing debug info: Start with LOCALSTACK_DEBUG=1 for verbose logging
  • Lambda issues: Check both the emulator logs and CloudWatch Logs
  • Intermittent errors: Look for resource limits or timing issues
  • CLI-level problems: Check lstk.log in the directory reported by lstk config path

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 3526362. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 3 months ago

README badge

README badge for localstack/skills/logs-analysis