{"id":29017866,"url":"https://github.com/cakephp/log","last_synced_at":"2026-03-06T22:32:24.131Z","repository":{"id":60774259,"uuid":"24731649","full_name":"cakephp/log","owner":"cakephp","description":"[READ-ONLY] Logging library with support for multiple different streams. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp","archived":false,"fork":false,"pushed_at":"2025-12-05T22:26:45.000Z","size":17149,"stargazers_count":25,"open_issues_count":0,"forks_count":3,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-12-09T12:12:59.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cakephp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-10-02T18:42:07.000Z","updated_at":"2025-11-01T13:12:22.000Z","dependencies_parsed_at":"2025-12-06T10:08:14.918Z","dependency_job_id":null,"html_url":"https://github.com/cakephp/log","commit_stats":{"total_commits":193,"total_committers":28,"mean_commits":6.892857142857143,"dds":0.7150259067357513,"last_synced_commit":"47fbee613a15e8a0f421912a2e641f249842e6d5"},"previous_names":[],"tags_count":316,"template":false,"template_full_name":null,"purl":"pkg:github/cakephp/log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Flog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Flog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Flog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Flog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cakephp","download_url":"https://codeload.github.com/cakephp/log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Flog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30201001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2025-06-25T23:07:17.218Z","updated_at":"2026-03-06T22:32:24.110Z","avatar_url":"https://github.com/cakephp.png","language":"PHP","readme":"[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/log.svg?style=flat-square)](https://packagist.org/packages/cakephp/log)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE.txt)\n\n# CakePHP Logging Library\n\nThe Log library provides a `Log` service locator for interfacing with\nmultiple logging backends using a simple interface. With the `Log` class it is\npossible to send a single message to multiple logging backends at the same time\nor just a subset of them based on the log level or context.\n\nBy default, you can use Files or Syslog as logging backends, but you can use any\nobject implementing `Psr\\Log\\LoggerInterface` as an engine for the `Log` class.\n\n## Usage\n\nYou can define as many or as few loggers as your application needs. Loggers\nshould be configured using `Cake\\Core\\Log.` An example would be:\n\n```php\nuse Cake\\Cache\\Cache;\n\nuse Cake\\Log\\Log;\n\n// Short classname\nLog::config('local', [\n    'className' =\u003e 'FileLog',\n    'levels' =\u003e ['notice', 'info', 'debug'],\n    'file' =\u003e '/path/to/file.log',\n]);\n\n// Fully namespaced name.\nLog::config('production', [\n    'className' =\u003e \\Cake\\Log\\Engine\\SyslogLog::class,\n    'levels' =\u003e ['warning', 'error', 'critical', 'alert', 'emergency'],\n]);\n```\n\nIt is also possible to create loggers by providing a closure.\n\n```php\nLog::config('special', function () {\n\t// Return any PSR-3 compatible logger\n\treturn new MyPSR3CompatibleLogger();\n});\n```\n\nOr by injecting an instance directly:\n\n```php\nLog::config('special', new MyPSR3CompatibleLogger());\n```\n\nYou can then use the `Log` class to pass messages to the logging backends:\n\n```php\nLog::write('debug', 'Something did not work');\n```\n\nOnly the logging engines subscribed to the log level you are writing to will\nget the message passed. In the example above, only the 'local' engine will get\nthe log message.\n\n### Filtering messages with scopes\n\nThe Log library supports another level of message filtering. By using scopes,\nyou can limit the logging engines that receive a particular message.\n\n```php\n// Configure /logs/payments.log to receive all levels, but only\n// those with `payments` scope.\nLog::config('payments', [\n    'className' =\u003e 'FileLog',\n    'levels' =\u003e ['error', 'info', 'warning'],\n    'scopes' =\u003e ['payments'],\n    'file' =\u003e '/logs/payments.log',\n]);\n\nLog::warning('this gets written only to payments.log', ['scope' =\u003e ['payments']]);\n```\n\n## Documentation\n\nPlease make sure you check the [official documentation](https://book.cakephp.org/4/en/core-libraries/logging.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcakephp%2Flog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcakephp%2Flog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcakephp%2Flog/lists"}