- What is koderhut/onelog-bundle and what problem does it solve?
- koderhut/onelog-bundle is a Symfony bundle that consolidates application, service, and runtime log output into a single configurable Monolog channel. It aims to reduce Monolog configuration overhead by providing sensible defaults and a predictable logging setup. It is not a Laravel package, so Laravel applications would need an adapter rather than native integration.
- Does koderhut/onelog-bundle work with Laravel?
- Not natively. The package is a Symfony bundle registered through a Kernel and dependency-injection extension, and Laravel has no boot surface for that. You could bridge it with a custom service provider and adapter, but Laravel's built-in Monolog configuration already covers the same use case with less proprietary surface.
- How do I install koderhut/onelog-bundle?
- Install it with Composer using composer require koderhut/onelog-bundle. In Symfony, enable the bundle and configure it through the bundle's configuration tree. In Laravel, Composer will install the code but package discovery will not register it, so you must wire it manually or skip it in favor of Laravel's native logging.
- How do I configure koderhut/onelog-bundle to use a single log channel?
- Configuration is done through the Symfony bundle config, typically under config/packages, where you define the unified channel and handler defaults. It is not configured through Laravel's config/logging.php. If you are adapting it for Laravel, you would need to map its channel settings into Laravel's logging configuration yourself.
- Is koderhut/onelog-bundle compatible with Monolog and PSR-3?
- Yes, the bundle is described as Monolog and PSR-3 friendly and works with existing handlers, processors, and loggers. It is a consolidation layer around Monolog rather than a replacement for it. In Laravel, the same PSR-3 and Monolog facilities are already available through the framework's logging stack.
- What changed in koderhut/onelog-bundle 1.2.0?
- Version 1.2.0 adds middleware for message and context pre-processing, allowing the logger to accept objects and extract data from them before delegating to the underlying logger. That overlaps with Monolog's ProcessorInterface, which already supports message and context mutation before handler dispatch. It also introduces object traversal into the logging path, which raises new production concerns.
- Is koderhut/onelog-bundle actively maintained?
- The 1.2.0 release came after a gap of roughly seven years, so it shows the maintainer is not completely inactive but does not establish a release cadence or support commitment. The package has about one star and zero dependents, which means little community validation. Under MIT there is no security-response obligation, so treat maintainer reachability as unknown and worth confirming before production use.
- What are the best alternatives to koderhut/onelog-bundle in Laravel?
- Laravel's native logging already provides Monolog channels, stack channels, formatters, and processors through config/logging.php. You can use tap or processors arrays, or call pushProcessor on a logger, to enrich messages and context. For most Laravel applications this removes the need for a Symfony-style bundle.
- What are the production risks of the object pre-processing in koderhut/onelog-bundle 1.2.0?
- Letting the logger accept objects means application code such as getters, magic __get, or lazy relations can execute during log emission. That can trigger database queries, hang on circular references, or leak PII into log storage. The cost is also paid per sink per event under fan-out. Monolog processors can cause the same damage, but you control them directly, so review and sanitize any object hydration in the log path.
- How should I test koderhut/onelog-bundle in a Laravel application?
- If you build an adapter, test that the service provider registers the logger, that configuration is merged correctly, and that records reach the expected Monolog channel. Use a Monolog TestHandler or a fake PSR-3 logger to assert messages and context without writing to real storage. Include tests for object pre-processing with simple DTOs and assert that no lazy loading, queries, or PII leakage occurs.