Skip to content

Improve logging integration with VIP-CLI#170

Merged
rinatkhaziev merged 3 commits intomainfrom
refactor/unified-logging
Jan 23, 2026
Merged

Improve logging integration with VIP-CLI#170
rinatkhaziev merged 3 commits intomainfrom
refactor/unified-logging

Conversation

@rinatkhaziev
Copy link
Copy Markdown

This pull request refactors and enhances the logging system to provide better log context, flexibility, and maintainability. The main improvements include support for logger child instances with contextual log names, more flexible configuration for log file output, and improved handling of sanitized keys for sensitive information. These changes impact the logger implementation and how loggers are instantiated and used throughout the application.

Logger architecture and context improvements:

  • Added support for creating child loggers with contextual logName using a new child method in the Log class, enabling better separation and identification of log messages from different components. (lib/logger.js, lib/app.js) [1] [2]
  • Modified logger instantiation in App and Lando classes to utilize the new child logger functionality, ensuring each app instance logs with its own context. (lib/app.js, lib/lando.js) [1] [2]

Logging configuration and file output:

  • Enhanced the Log class constructor to accept a logFile parameter, allowing logs to be written to a specific file, and improved logic for file transport setup (including absolute/relative paths and directory creation). (lib/logger.js) [1] [2]
  • Refined the logic for exposing transports and handling file transport selection, simplifying and improving compatibility with tests. (lib/logger.js)

Sensitive data handling:

  • Improved propagation and updating of sanitizedKeys (the list of keys to redact in logs), ensuring child loggers and logger instances created with an existing logger maintain consistent sanitization. (lib/logger.js) [1] [2]

Log formatting:

  • Updated log formatting functions to correctly resolve and display the appropriate logName in both console and file outputs, improving clarity and traceability of log messages. (lib/logger.js) [1] [2] [3]

@rinatkhaziev rinatkhaziev changed the title Replay changes in VIP-CLI to unify the logging Improve logging integration with VIP-CLI Jan 20, 2026
@rinatkhaziev rinatkhaziev merged commit 459ac2d into main Jan 23, 2026
18 checks passed
@rinatkhaziev rinatkhaziev deleted the refactor/unified-logging branch January 23, 2026 18:42
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