{"id":27286639,"url":"https://github.com/stagerightlabs/command-line-logger","last_synced_at":"2026-02-11T09:02:50.002Z","repository":{"id":275848905,"uuid":"927390415","full_name":"stagerightlabs/command-line-logger","owner":"stagerightlabs","description":"A command line logging channel for Laravel","archived":false,"fork":false,"pushed_at":"2025-03-01T01:29:57.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T20:59:18.283Z","etag":null,"topics":["console","laravel","logging"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stagerightlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-04T21:51:55.000Z","updated_at":"2025-03-01T01:28:55.000Z","dependencies_parsed_at":"2025-04-11T19:43:49.859Z","dependency_job_id":"514ee03c-f925-406b-a074-c9f3a81b8f88","html_url":"https://github.com/stagerightlabs/command-line-logger","commit_stats":null,"previous_names":["stagerightlabs/command-line-logger"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/stagerightlabs/command-line-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagerightlabs%2Fcommand-line-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagerightlabs%2Fcommand-line-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagerightlabs%2Fcommand-line-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagerightlabs%2Fcommand-line-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stagerightlabs","download_url":"https://codeload.github.com/stagerightlabs/command-line-logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagerightlabs%2Fcommand-line-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29330858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["console","laravel","logging"],"created_at":"2025-04-11T19:43:33.211Z","updated_at":"2026-02-11T09:02:49.968Z","avatar_url":"https://github.com/stagerightlabs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Write Laravel log messages to the console](https://banners.beyondco.de/Command%20Line%20Logger.png?theme=light\u0026packageManager=composer+require\u0026packageName=stagerightlabs%2Fcommand-line-logger\u0026pattern=graphPaper\u0026style=style_1\u0026description=Write+log+messages+to+the+console+while+respecting+output+verbosity\u0026md=1\u0026showWatermark=1\u0026fontSize=100px\u0026images=https%3A%2F%2Flaravel.com%2Fimg%2Flogomark.min.svg)\n\n# Write log messages to the command line while respecting output verbosity\n\nArtisan commands accepts 'verbosity' level flags which indicate the level of desired output: `-v`, `-vv` and `-vvv`. These come from the underlying Symfony/Console package and are often overlooked in the Laravel ecosystem. Respecting verbosity can be rather cumbersome and adds noise to your code:\n\n```php\nif ($this-\u003egetOutput()-\u003eisDebug()) {\n    $this-\u003einfo('To an old pond');\n}\n\nif ($this-\u003egetOutput()-\u003eisVeryVerbose()) {\n    $this-\u003einfo('A frog leaps in');\n}\n\nif ($this-\u003egetOutput()-\u003eisVerbose()) {\n    $this-\u003einfo('And the sound of the water');\n}\n\n$this-\u003einfo('- Matsu Basho');\n```\n\nThe goal of this package is to streamline command output while still respecting verbosity flags. We do that by creating a `console` log channel and sending log messages to the command line rather than using the native Artisan output helpers such as `info()` and `error()`.\n\nWith this package installed and configured, the above example would instead look like this:\n\n```php\nLog::debug('To an old pond');\nLog::info('A frog leaps in');\nLog::notice('And the sound of the water');\nLog::warning('- Matsu Basho');\n```\n\nWhen you call the command those messages would appear in the console output based on the verbosity flag provided:\n\n| Level   | Verbosity    |\n| ------- | ------------ |\n| Error   | Quiet        |\n| Warning | Normal       |\n| Notice  | Verbose      |\n| Info    | Very Verbose |\n| Debug   | Debug        |\n\nWhen combined with a log stack the output will also be logged to those other channels as well, which is an added bonus.\n\nThis package is an implementation of the Symfony Monolog Bridge [Console Handler](https://symfony.com/doc/current/logging/monolog_console.html) for Laravel.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require stagerightlabs/command-line-logger\n```\n\nMake sure you do not have an existing log channel called \"console\" otherwise there may be conflicts.\n\nAfter installing the package you will need to add the \"console\" destination channel to your logging config. This can be done in a `.env` file:\n\n```\nLOG_CHANNEL=stack\nLOG_STACK=single,console\n```\n\nYou could also make this change in the `config/logging.php` file:\n\n```php\n'stack' =\u003e [\n    'driver' =\u003e 'stack',\n    'channels' =\u003e ['single', 'console'],\n    'ignore_exceptions' =\u003e false,\n],\n```\n\nYou don't need to use the \"console\" channel with a stack but it can be helpful.\n\n## Usage\n\nInstead of writing console output directly from the Artisan command, you should now write to the logs instead:\n\n```php\n// Instead of this\n$this-\u003einfo('Matsu Basho');\n\n// Do this\nLog::info('Matsu Basho');\n```\n\nThese messages will appear in the console depending on the log level and the verbosity settings given to the command. See the above table for more details.\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email ryan@stagerightlabs.com instead of using the issue tracker.\n\n## Credits\n\nThe original idea comes from the [Symfony Monolog Bridge](https://github.com/symfony/symfony/blob/727ae99526ed907e5abc5e8ee59187c2139b1096/src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php). More information in [the Symfony Docs](https://symfony.com/doc/current/logging/monolog_console.html).\n\nFor this version:\n\n-   [Ryan C. Durham](https://github.com/stagerightlabs)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe Apache License 2. Please see [License File](LICENSE.md) for more information.\n\n## Laravel Package Boilerplate\n\nThis package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstagerightlabs%2Fcommand-line-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstagerightlabs%2Fcommand-line-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstagerightlabs%2Fcommand-line-logger/lists"}