{"id":19107859,"url":"https://github.com/alleyinteractive/logger","last_synced_at":"2025-04-07T05:09:02.805Z","repository":{"id":11383312,"uuid":"67897281","full_name":"alleyinteractive/logger","owner":"alleyinteractive","description":"A Monolog-based logging tool for WordPress. Supports storing log message in a custom post type or in individual posts and terms.","archived":false,"fork":false,"pushed_at":"2024-12-20T16:53:20.000Z","size":3950,"stargazers_count":29,"open_issues_count":6,"forks_count":4,"subscribers_count":49,"default_branch":"develop","last_synced_at":"2025-03-12T21:48:20.227Z","etag":null,"topics":["logger","logging","monolog","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","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/alleyinteractive.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-09-10T22:21:24.000Z","updated_at":"2025-02-26T14:01:27.000Z","dependencies_parsed_at":"2024-03-18T03:28:55.324Z","dependency_job_id":"83186bed-ef9a-4c83-a6c0-142c8d8e3f3a","html_url":"https://github.com/alleyinteractive/logger","commit_stats":{"total_commits":217,"total_committers":6,"mean_commits":"36.166666666666664","dds":"0.16129032258064513","last_synced_commit":"f990a510f605bcfb7229a65770acd245b7df8826"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alleyinteractive%2Flogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alleyinteractive%2Flogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alleyinteractive%2Flogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alleyinteractive%2Flogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alleyinteractive","download_url":"https://codeload.github.com/alleyinteractive/logger/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595334,"owners_count":20963943,"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":["logger","logging","monolog","wordpress","wordpress-plugin"],"created_at":"2024-11-09T04:14:12.106Z","updated_at":"2025-04-07T05:09:02.758Z","avatar_url":"https://github.com/alleyinteractive.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logger\n\n![Testing\nSuite](https://github.com/alleyinteractive/logger/workflows/Testing%20Suite/badge.svg)\n![Coding Standards](https://github.com/alleyinteractive/logger/workflows/Coding%20Standards/badge.svg)\n\nProviding a WordPress integration with Monolog, allowing site-wide and post and\nterm specific logging.\n\n![Screenshot of Example Log](https://user-images.githubusercontent.com/346399/81981285-197bd880-95fe-11ea-8645-1bb0fa3569a8.png)\n\n## Documentation\n\nSee the [wiki](https://github.com/alleyinteractive/logger/wiki) for complete information and more examples.\n\n## Installation\n\nLogger requires PHP 8.1 and Composer to run properly.\n\n```bash\ncomposer require alleyinteractive/logger\n```\n\nYou can also install the plugin as a submodule by using the `*-built` tag of a\nrelease.\n\n## Usage\n\nAI Logger is a complete interface to Monolog with some nice WordPress handlers built in.\n\n```php\n// Log site-wide to the ai_log post type.\nai_logger()-\u003einfo( 'Log message...' );\n\n\\AI_Logger\\AI_Logger::info( 'Another format for logging.' );\n```\n\n### Logging to a Specific Post\n\nLogs will be appended to a post's meta for review.\n\n```php\nai_logger_to_post( $post_id, 'meta-key' )-\u003einfo( 'This will log to the \u003cmeta-key\u003e for a specific post.' );\n```\n\n### Logging to a Specific Term\n\nLogs will be appended to a term's meta for review.\n\n```php\nai_logger_to_term( $term_id, 'meta-key' )-\u003einfo( 'This will log to the \u003cmeta-key\u003e for a specific term.' );\n```\n\n### Logging to Query Monitor\n\n```php\nai_logger_to_qm()-\u003einfo( 'This will show up in Query Monitor!' );\n```\n\n### Logging with Default Context\n\n```php\nai_logger()-\u003ewith_context( 'example-context' )-\u003einfo( 'This will log to the example-context.' );\n```\n\nAlso supports an array of default log context:\n\n```php\nai_logger()-\u003ewith_context(\n\t[\n\t\t'context' =\u003e 'example-context',\n\t\t'key'     =\u003e 'value',\n\t]\n)-\u003einfo( 'This will log to the example-context with key=\u003evalue.' );\n```\n\nYou can also pass the context to `ai_logger()` directly:\n\n```php\nai_logger( 'example-context' )-\u003einfo( 'This will log to the example-context.' );\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed\nrecently.\n\n## Maintainers\n\nThis project is actively maintained by [Alley\nInteractive](https://github.com/alleyinteractive). Like what you see? [Come work\nwith us](https://alley.com/careers/).\n\n![Alley logo](https://avatars.githubusercontent.com/u/1733454?s=200\u0026v=4)\n\n## License\n\nThis software is released under the terms of the GNU General Public License\nversion 2 or any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falleyinteractive%2Flogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falleyinteractive%2Flogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falleyinteractive%2Flogger/lists"}