-
Notifications
You must be signed in to change notification settings - Fork 561
enable debug logs #2106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable debug logs #2106
Conversation
There was a problem hiding this 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
This comment has been minimized.
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' |
There was a problem hiding this comment.
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:
- In
backend/logging/context_logger.go
, DEBUG level enables additional logging of internal system details - In
backend/models/setup.go
, DEBUG level enablesWithTraceAll(true)
for database operations, which logs all SQL queries including potentially sensitive data - 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.
DIGGER_LOG_LEVEL = 'DEBUG' | |
DIGGER_LOG_LEVEL = 'INFO' |
No description provided.