Feat: Improve log file handling for connector failures#333
Conversation
WalkthroughWalkthroughThe recent changes enhance the logging functionality in the Airbyte application. Key modifications include standardizing the logging root path, introducing a caching function for efficient retrieval of the logging directory, and improving log file naming conventions for better context. These updates aim to streamline logging processes and enhance clarity in log file management. Changes
Wydt about this summary? Would you like to include any additional details or modifications? Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
|
CodeRabbit (@coderabbitai) review |
1 similar comment
|
CodeRabbit (@coderabbitai) review |
There was a problem hiding this comment.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (2)
airbyte/constants.py (1)
66-73: Clarify the documentation forAIRBYTE_LOGGING_ROOT.The documentation for
AIRBYTE_LOGGING_ROOTis clear, but consider explicitly stating the default path in the docstring for quick reference.""" The root directory for Airbyte logs. This value can be overridden by setting the `AIRBYTE_LOGGING_ROOT` environment variable. If not provided, PyAirbyte will use `/tmp/airbyte/logs/` where `/tmp/` is the OS's default temporary directory. """airbyte/exceptions.py (1)
Line range hint
273-287:
Review_get_log_filemethod for robustness.The
_get_log_filemethod retrieves the log file path from logger handlers. Ensure that this method correctly handles cases where no file handler is present or the logger is misconfigured.def _get_log_file(self) -> Path | None: """Return the log file path for the connector.""" if self.connector_name: logger = logging.getLogger(f"airbyte.{self.connector_name}") log_paths = [ Path(handler.baseFilename).absolute() for handler in logger.handlers if isinstance(handler, logging.FileHandler) and hasattr(handler, 'baseFilename') ] if log_paths: return log_paths[0] return None
|
/fix-pr
|
This does a few small but nice things:
AIRBYTE_LOGGING_ROOTenv var processing into the publicconstantsmodule so that it is self-documenting in our API docs.Summary by CodeRabbit
New Features
Documentation