- Is zhamao/logger a Laravel package?
- No. It is a standalone PHP console logger from the Zhamao ecosystem, with no service provider, facade, configuration file, or Laravel logging channel driver. You can use it beside Laravel for CLI-style code, but it does not plug into Laravel's logging stack directly.
- How do I install zhamao/logger with Composer?
- Install it through Composer using the package name zhamao/logger. Before installing, check the package's composer.json for PHP and extension constraints because the evaluation notes those requirements are not verifiable from the metadata. Confirm it does not pin psr/log or Monolog in a way that conflicts with your Laravel app.
- Can I use zhamao/logger as a Laravel logging channel?
- Not natively. Laravel channels expect Monolog handlers or a PSR-3 logger, and this package provides neither a channel driver nor a PSR-3 implementation. You would need to write glue such as a Monolog handler delegating write calls or a PSR-3 adapter, and you would own that glue forever. The evaluation recommends a spike or a custom formatter instead of adoption.
- Does zhamao/logger implement PSR-3 LoggerInterface?
- The available evaluation says version 1.1.9 does not add a PSR-3 implementation, so a PSR-3 adapter remains mandatory for Laravel integration. Assume it is not PSR-3 compliant unless you verify the source yourself. If you need PSR-3 logging, wrap it or use Monolog.
- How do I configure log levels and output in zhamao/logger?
- The package advertises configurable log levels plus file and console output. Exact configuration options are not documented in the provided metadata, so check the repository README and source before relying on them. In a Laravel app, you would likely configure it in your own CLI entry point rather than through config/logging.php.
- Is zhamao/logger safe for long-running Laravel queue workers?
- It writes synchronously to stdout using echo, fwrite, and fflush, so output is blocking and unbuffered by default. The evaluation flags unresolved concerns about broken pipes, non-TTY environments, and whether un-suppressed fwrite warnings become ErrorExceptions under Laravel's error handler after 1.1.9. Test those paths before using it in production workers.
- What PHP version and extensions does zhamao/logger require?
- The metadata does not provide a PHP support matrix or extension requirements, and the evaluation says compatibility is unverifiable without checking composer.json. Confirm the PHP constraint against your runtime, for example PHP 8.2 or 8.3, and check for hard requirements such as ext-swoole, ext-posix, or ext-pcntl before installing. Also verify that it does not pin psr/log or Monolog.
- Does zhamao/logger support JSON or structured logging?
- The provided context does not confirm structured JSON output; it only describes configurable levels and file and console output. The evaluation lists structured output as an open question. If you need JSON logs for Laravel, Monolog formatters are the safer, supported path.
- Is zhamao/logger actively maintained and production-ready?
- It has a single maintainer, one star, zero dependents, and no Laravel integration tests or PHP support matrix. Version 1.1.9 is a positive but marginal hardening patch that removes error suppression from echo, fwrite, and fflush; it does not change the bus factor. Treat it as high-risk for production, especially because logs can contain secrets, tokens, and PII.
- What are alternatives to zhamao/logger for Laravel CLI logging?
- Laravel's built-in Log facade and Monolog already provide channel routing, PSR-3 compliance, formatters, and drivers for daily, stderr, syslog, and stack outputs. For console-style output, a custom Monolog LineFormatter subclass or a small handler is usually enough. The evaluation recommends comparing output quality against a hand-written formatter before adding this dependency.