{"id":28955799,"url":"https://github.com/kodedphp/logging","last_synced_at":"2026-04-02T01:56:22.214Z","repository":{"id":46778631,"uuid":"83178237","full_name":"kodedphp/logging","owner":"kodedphp","description":"Simple and fast logger package.","archived":false,"fork":false,"pushed_at":"2025-06-23T14:31:59.000Z","size":99,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-23T14:49:30.649Z","etag":null,"topics":["log","log-processor","logger","logging","logging-library","psr-3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kodedphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-26T02:49:00.000Z","updated_at":"2025-06-23T14:30:30.000Z","dependencies_parsed_at":"2022-09-22T14:25:56.633Z","dependency_job_id":null,"html_url":"https://github.com/kodedphp/logging","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/kodedphp/logging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Flogging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Flogging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Flogging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Flogging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kodedphp","download_url":"https://codeload.github.com/kodedphp/logging/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Flogging/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261548741,"owners_count":23175499,"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":["log","log-processor","logger","logging","logging-library","psr-3"],"created_at":"2025-06-23T20:10:05.804Z","updated_at":"2026-04-02T01:56:22.185Z","avatar_url":"https://github.com/kodedphp.png","language":"PHP","readme":"Koded - Logging Library\n=======================\n\nA simple message logging library that implements [PSR-3][psr-3]\nwith several log processors. It supports multiple log writers that\ncan be set separately and process messages based on the log level.\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/koded/logging.svg)](https://packagist.org/packages/koded/logging)\n[![Build Status](https://travis-ci.org/kodedphp/logging.svg?branch=master)](https://travis-ci.org/kodedphp/logging)\n[![Code Coverage](https://scrutinizer-ci.com/g/kodedphp/logging/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/kodedphp/logging/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/kodedphp/logging/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/kodedphp/logging/?branch=master)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.1-8892BF.svg)](https://php.net/)\n\n\nInstallation\n------------\n\nUse [composer][composer] and run \n\u003e `composer require koded/logging`\n\nor add it manually in your current `composer.json`\n```json\n{\n  \"require\": {\n    \"koded/logging\": \"^3\"\n  }\n}\n```\n\nUsage\n-----\n\n```php\n\u003c?php\n\n$settings = [\n    [\n        ['class' =\u003e Cli::class, 'levels' =\u003e Log::ERROR],\n        ['class' =\u003e File::class, 'levels' =\u003e Log::INFO]\n    ]\n];\n\n$log = new Log(...$settings);\n\n// This message is processed by Cli and File\n$log-\u003ealert('The message with {variable}', ['variable' =\u003e 'useful info']);\n\n// This message won't be processed by Cli \n// because it's level is below ERROR,\n// but File will handle it\n$log-\u003ewarning(\"You don't see anything\");\n```\n\nConfiguration\n-------------\n\n| Param        | Type   | Required | Default         | Description |\n|-------------:|:------:|:--------:|:----------------|:------------|\n| (processors) | array  | yes      | (empty)         | An array of log processors. Every processor is defined in array with it's own configuration parameters. See [processor directives](processor-default-directives) |\n| dateformat   | string | no       | \"d/m/Y H:i:s.u\" | The date format for the log message. Microseconds are prepended by default |\n| timezone     | string | no       | \"UTC\"           | The desired timezone for the log message |\n\n\n### Processor default directives\n\nEvery log processor has it's own set of configuration directives.  \nThe table shows log parameters in the classes.\n\n| Param      | Type    | Required | Default       | Description |\n|:-----------|:--------|:--------:|:--------------|:------------|\n| class      | string  | yes      |               | The name of the log processor class |\n| levels     | integer | no       | -1            | Packed integer for bitwise comparison. See the constants in Logger class |\n\n\n### Levels example\n\nThe messages are filtered with bitwise operator against the `levels` value.\nEvery processor will filter out the messages as defined in it's **levels** directive.\n\nFor instance, to log only WARNING, INFO and ERROR messages, set levels to\n\n```php\n\u003c?php\n\n[..., ['levels' =\u003e Log::WARN | Log::INFO | Log::ERROR, ...]],\n```\n\nTips:\n- every processor is configured separately\n- if you want to process all log levels, skip the `levels` value or set it to -1 (by default)\n- if you want to suppress a specific processor, set it's level to 0\n\n\nProcessors\n----------\n\n| Class name  | Description                                                                          |\n|------------:|:-------------------------------------------------------------------------------------|\n| ErrorLog    | uses the [error_log()][error-log] function to send the message to PHP's logger       |\n| Cli         | write the messages in the console (with STDERR)                                      |\n| Memory      | will store all messages in an array. Useful for unit tests if the logger is involved |\n| SysLog      | will open the system logger and send messages using the [syslog()][syslog] function  |\n| File        | saves the messages on a disk                                                         |\n\n\nBenchmarks and tests\n--------------------\n\n```shell script\nvendor/bin/phpbench run --report=default\nvendor/bin/phpunit\n```\n\n\nLicense\n-------\n[![Software license](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE)\nThe code is distributed under the terms of [The 3-Clause BSD license](LICENSE).\n\n[psr-3]: http://www.php-fig.org/psr/psr-3/\n[composer]: https://getcomposer.org/download/\n[error-log]: http://php.net/error_log\n[syslog]: http://php.net/syslog\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedphp%2Flogging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkodedphp%2Flogging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedphp%2Flogging/lists"}