- What is graham-campbell/logger-core used for?
- It provides core logging utilities for Laravel, specifically the logger service provider and a factory for building PSR-3 loggers with custom handlers and processors. It also ships a logger trait for reuse in your own classes. The code was extracted from the Laravel Logger package so the same utilities can be consumed standalone as a smaller dependency.
- How do I install graham-campbell/logger-core with Composer?
- Install it with composer require graham-campbell/logger-core. The package assumes standard Composer autoloading, so no build-system changes are needed. In a full Laravel application the service provider is expected to be discovered automatically; in Lumen you must register it manually.
- Does logger-core support Lumen?
- Yes. Version 1.1.0 added official Lumen support, which means the package can run outside a full Laravel application kernel in thin API services or workers. Lumen does not auto-discover packages, so you must register the service provider yourself in bootstrap/app.php. The release notes do not state which Lumen versions are covered, so confirm compatibility for your target version first.
- Which Laravel and PHP versions does logger-core support?
- The reviewed material does not state an explicit minimum PHP, Laravel, or Lumen version, so check the composer.json constraints before installing. The 1.1.0 release is a minor bump with no breaking changes signalled. Run a short spike against your exact framework version rather than assuming a support window.
- How do I register logger-core in a Lumen application?
- Because Lumen has no package auto-discovery, you add an explicit $app->register(...) call for the package's service provider in bootstrap/app.php. That manual step also means there may be no automatic config merge or publish tags. Verify the exact provider class and any config-publishing path against the repository README before wiring it in.
- What is the logger trait in logger-core and how do I use it?
- The package provides a logger trait for reuse, letting you drop shared logging behaviour into your own classes instead of duplicating wiring. It is designed to pair with the logger factory, which builds PSR-3 loggers with custom handlers and processors. Include the trait in your class and resolve the logger through the factory or container.
- Can I add custom handlers and processors to the logger?
- Yes. The package is described as providing a logger factory for building PSR-3 loggers with custom handlers and processors, so you can compose your own logging stack rather than accept a fixed one. This is useful when you need specific Monolog handlers for files, streams, or external services. Check the source for the exact factory method signatures and how configuration is passed in.
- How does logger-core relate to the full graham-campbell/logger package?
- logger-core is the extracted core of the Laravel Logger package, containing the service provider, the logger factory, and the reusable logger trait. It is not presented as a drop-in replacement for the full package's broader feature set. If you only need PSR-3 logger construction with custom handlers and processors, the core package keeps the dependency footprint smaller.
- Is logger-core production ready and well tested?
- The 1.1.0 release notes mention only that a couple of tests were added, which suggests test coverage is still early. There is no stated information about CI configuration, matrix coverage across framework versions, static analysis, or whether the Laravel and Lumen paths are both exercised. Treat it as plausible but unverified: run a short integration spike plus your own test suite before relying on it in production.
- Is upgrading to logger-core 1.1.0 safe, and are there breaking changes?
- Version 1.1.0 is a minor bump for additive Lumen support, with no deprecations or breaking changes signalled, so semver hygiene looks correct. A routine upgrade is a constraint bump, then run your suite and confirm the service-provider registration shape has not changed. If you are Laravel-only, this release is close to a no-op and can be handled as a low-priority version bump.