{"id":19326026,"url":"https://github.com/linkorb/flex-log","last_synced_at":"2026-05-17T10:31:14.329Z","repository":{"id":62517375,"uuid":"183585501","full_name":"linkorb/flex-log","owner":"linkorb","description":"FlexLog: configurable logging for your application","archived":false,"fork":false,"pushed_at":"2023-02-03T09:26:44.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-22T10:17:00.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkorb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-26T08:02:51.000Z","updated_at":"2023-02-03T09:26:31.000Z","dependencies_parsed_at":"2023-02-18T05:16:03.617Z","dependency_job_id":null,"html_url":"https://github.com/linkorb/flex-log","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fflex-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fflex-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fflex-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fflex-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkorb","download_url":"https://codeload.github.com/linkorb/flex-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240427316,"owners_count":19799471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-10T02:12:13.914Z","updated_at":"2026-05-17T10:31:09.308Z","avatar_url":"https://github.com/linkorb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flex-log\nFlexLog: flexible configurable logging for your applications\n\nAllows reconfiguring the handlers, processor and formatters of your application's loggers through environment variables and config files.\n\nFlexLog is a very thin wrapper around the awesome [monolog-cascade](https://github.com/theorchard/monolog-cascade) library.\n\nIt adds:\n\n* simple initialization based on the config file specified by the `FLEX_LOG` environment variable\n* ensures that all loggers your application expects are always added to Monolog's Registry, even if no cascade config file is used, or it misses a definition for that logger name.\n\n## Configuration\n\n```\n## Specify a cascade config file (yaml):\nFLEX_LOG=/path/to/my/cascade.yaml\n```\n\n## Usage\n\nAt the earliest entry point in your application (index.php, bootstap.php, etc), add the following line to initialize FlexLog:\n\n```php\nuse FlexLog\\FlexLog;\n\nFlexLog::initFromEnv()\nFlexLog::ensureLoggers(['app', 'db', 'caching']); // ensures that loggers with these names exist and are registered\n```\n\nThen, from anywhere in your app, log to monolog as usual. For example by using Monolog's registry:\n\n```php\n$username = 'joe';\n\\Monolog\\Registry::app()-\u003einfo(\"User {username} logged in\", ['username' =\u003e $username]);\n```\n\nA fully working example can be found in the test cases in `tests/`\n\n## Tests\n```\n./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/\n```\n\n## Links\n\n* [Monolog Cascade](https://github.com/theorchard/monolog-cascade)\n* [Monolog](https://github.com/Seldaek/monolog)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Fflex-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkorb%2Fflex-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Fflex-log/lists"}