{"id":15089263,"url":"https://github.com/sergeymakinen/yii2-log-message","last_synced_at":"2025-10-05T21:31:41.903Z","repository":{"id":62542456,"uuid":"77979427","full_name":"sergeymakinen/yii2-log-message","owner":"sergeymakinen","description":"Log message object for Yii 2 log targets","archived":true,"fork":false,"pushed_at":"2020-09-15T20:19:40.000Z","size":49,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-03T10:46:26.676Z","etag":null,"topics":["log","log-message","logging","message","php","php-library","yii2","yii2-extension"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergeymakinen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-04T04:06:15.000Z","updated_at":"2022-12-04T18:11:18.000Z","dependencies_parsed_at":"2022-11-02T16:16:13.496Z","dependency_job_id":null,"html_url":"https://github.com/sergeymakinen/yii2-log-message","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sergeymakinen/yii2-log-message","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeymakinen%2Fyii2-log-message","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeymakinen%2Fyii2-log-message/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeymakinen%2Fyii2-log-message/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeymakinen%2Fyii2-log-message/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergeymakinen","download_url":"https://codeload.github.com/sergeymakinen/yii2-log-message/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeymakinen%2Fyii2-log-message/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278525526,"owners_count":26001321,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["log","log-message","logging","message","php","php-library","yii2","yii2-extension"],"created_at":"2024-09-25T08:41:54.699Z","updated_at":"2025-10-05T21:31:41.635Z","avatar_url":"https://github.com/sergeymakinen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yii 2 log message object\n\nLog message object that wraps a log message and exposes its properties as well as the current request/user details to Yii 2 log targets.\n\n[![Code Quality](https://img.shields.io/scrutinizer/g/sergeymakinen/yii2-log-message.svg?style=flat-square)](https://scrutinizer-ci.com/g/sergeymakinen/yii2-log-message) [![Build Status](https://img.shields.io/travis/sergeymakinen/yii2-log-message.svg?style=flat-square)](https://travis-ci.org/sergeymakinen/yii2-log-message) [![Code Coverage](https://img.shields.io/codecov/c/github/sergeymakinen/yii2-log-message.svg?style=flat-square)](https://codecov.io/gh/sergeymakinen/yii2-log-message) [![SensioLabsInsight](https://img.shields.io/sensiolabs/i/9900d5c1-2a54-4de4-9184-7815e1b22650.svg?style=flat-square)](https://insight.sensiolabs.com/projects/9900d5c1-2a54-4de4-9184-7815e1b22650)\n\n[![Packagist Version](https://img.shields.io/packagist/v/sergeymakinen/yii2-log-message.svg?style=flat-square)](https://packagist.org/packages/sergeymakinen/yii2-log-message) [![Total Downloads](https://img.shields.io/packagist/dt/sergeymakinen/yii2-log-message.svg?style=flat-square)](https://packagist.org/packages/sergeymakinen/yii2-log-message) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n\n## Installation\n\nThe preferred way to install this extension is through [composer](https://getcomposer.org/download/).\n\nEither run\n\n```bash\ncomposer require \"sergeymakinen/yii2-log-message:^2.0\"\n```\n\nor add\n\n```json\n\"sergeymakinen/yii2-log-message\": \"^2.0\"\n```\n\nto the require section of your `composer.json` file.\n\n## Usage\n\nLet's take a look at the [Slack log target](https://github.com/sergeymakinen/yii2-slack-log) code excerpt:\n\n```php\n// ...\n// $message is the sergeymakinen\\yii\\logmessage\\Message class instance\n$attachment = [\n    'fallback' =\u003e $this-\u003eencode($this-\u003eformatMessage($message-\u003emessage)),\n    'title' =\u003e ucwords($message-\u003elevel),\n    'fields' =\u003e [],\n    'text' =\u003e \"```\\n\" . $this-\u003eencode($message-\u003etext . \"\\n```\",\n    'footer' =\u003e static::className(),\n    'ts' =\u003e (int) round($message-\u003etimestamp),\n    'mrkdwn_in' =\u003e [\n        'fields',\n        'text',\n    ],\n];\nif ($message-\u003eisConsoleRequest) {\n    $attachment['author_name'] = $message-\u003ecommandLine;\n} else {\n    $attachment['author_name'] = $attachment['author_link'] = $message-\u003eurl;\n}\nif (isset($this-\u003ecolors[$message-\u003emessage[1]])) {\n    $attachment['color'] = $this-\u003ecolors[$message-\u003emessage[1]];\n}\n$this\n    -\u003einsertField($attachment, 'Level', $message-\u003elevel, true, false)\n    -\u003einsertField($attachment, 'Category', $message-\u003ecategory, true)\n    -\u003einsertField($attachment, 'Prefix', $message-\u003eprefix, true)\n    -\u003einsertField($attachment, 'User IP', $message-\u003euserIp, true, false)\n    -\u003einsertField($attachment, 'User ID', $message-\u003euserId, true, false)\n    -\u003einsertField($attachment, 'Session ID', $message-\u003esessionId, true)\n    -\u003einsertField($attachment, 'Stack Trace', $message-\u003estackTrace, false);\n// ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergeymakinen%2Fyii2-log-message","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergeymakinen%2Fyii2-log-message","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergeymakinen%2Fyii2-log-message/lists"}