Skip to content

Conversation

motatoes
Copy link
Contributor

No description provided.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR enables DEBUG level logging for the production digger-pro application by adding DIGGER_LOG_LEVEL = 'DEBUG' to the fly-pro.toml configuration file. The change modifies the Fly.io deployment configuration to set the log level environment variable, which is consumed by the backend's logging system (context_logger.go) that supports DEBUG, WARN, ERROR, and INFO levels.

The DEBUG log level is the most verbose setting and will expose detailed internal system operations including goroutine management, request tracing, cleanup operations, and other debugging information that is typically suppressed in production environments. This change integrates with Digger's existing logging infrastructure where both the CLI and backend components support consistent log level configuration through environment variables.

The modification fits into the codebase's logging architecture where the backend uses a configurable context logger that can be controlled via the DIGGER_LOG_LEVEL environment variable, ensuring that debugging information can be dynamically enabled across different deployment environments.

Confidence score: 2/5

  • This PR introduces significant risk by enabling verbose DEBUG logging in production, which can impact performance and expose sensitive information
  • Score reflects concerns about production stability, log volume, security implications, and potential performance degradation from excessive logging
  • Pay close attention to fly-pro.toml as this directly affects production logging behavior and system performance

Context used:

Context - Ensure consistency in log level support across different components (e.g., CLI and backend) by implementing the same log levels in both. (link)
Context - Enrich debug logs with relevant context. Always include identifiers like 'prNumber' in logs to facilitate easier tracing and troubleshooting. (link)
Context - Use consistent and descriptive keys for debug logging. For example, prefer 'prBatchCount' over 'len(prBatches)' to maintain clarity and adhere to naming conventions. (link)

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

This comment has been minimized.

@@ -13,7 +13,7 @@ primary_region = 'lhr'
DIGGER_PROJECTS_SVC_APP_NAME = 'projects-refresh-service'
DIGGER_LOAD_PROJECTS_ON_PUSH = 'true'
DIGGER_MAX_PROJECTS_PER_CHANGE=100

DIGGER_LOG_LEVEL = 'DEBUG'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting DIGGER_LOG_LEVEL to 'DEBUG' in a production environment (fly-pro.toml) is a security risk. Debug logging can expose sensitive information that shouldn't be visible in production.

From examining the codebase:

  1. In backend/logging/context_logger.go, DEBUG level enables additional logging of internal system details
  2. In backend/models/setup.go, DEBUG level enables WithTraceAll(true) for database operations, which logs all SQL queries including potentially sensitive data
  3. Multiple places in the code conditionally log additional information when DEBUG is enabled

While the system does have some filtering capabilities for sensitive values (as seen in libs/execution/io_writer_filtered.go), these are specifically for plan outputs and not for general logging. Debug logs can contain connection strings, internal state, and other sensitive information that should not be exposed in production.

The appropriate log level for a production environment should be 'INFO' which provides operational visibility without exposing sensitive details.

Suggested change
DIGGER_LOG_LEVEL = 'DEBUG'
DIGGER_LOG_LEVEL = 'INFO'

@motatoes motatoes merged commit a4d23a2 into develop Aug 22, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants