{"id":13462493,"url":"https://github.com/overtrue/laravel-query-logger","last_synced_at":"2025-05-14T14:07:33.852Z","repository":{"id":24836212,"uuid":"102495270","full_name":"overtrue/laravel-query-logger","owner":"overtrue","description":":pencil: A dev tool to log all queries for laravel application.","archived":false,"fork":false,"pushed_at":"2025-02-20T15:32:20.000Z","size":55,"stargazers_count":408,"open_issues_count":2,"forks_count":50,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-11T20:44:13.488Z","etag":null,"topics":["laravel","logger","query","query-logger"],"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/overtrue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["overtrue"]}},"created_at":"2017-09-05T14:59:41.000Z","updated_at":"2025-04-09T08:58:10.000Z","dependencies_parsed_at":"2025-01-30T17:12:21.699Z","dependency_job_id":"b7ee19c4-488b-479d-82e1-48c9ccd002f3","html_url":"https://github.com/overtrue/laravel-query-logger","commit_stats":{"total_commits":59,"total_committers":15,"mean_commits":3.933333333333333,"dds":"0.35593220338983056","last_synced_commit":"b9fb545cf2a47c96a16f666f7ab519d128b3496f"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-query-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-query-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-query-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-query-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/overtrue","download_url":"https://codeload.github.com/overtrue/laravel-query-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159194,"owners_count":22024558,"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":["laravel","logger","query","query-logger"],"created_at":"2024-07-31T12:00:49.602Z","updated_at":"2025-05-14T14:07:33.798Z","avatar_url":"https://github.com/overtrue.png","language":"PHP","funding_links":["https://github.com/sponsors/overtrue"],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\u003ch1 align=\"center\"\u003e Laravel Query Logger \u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e :pencil: A dev tool to log all queries for Laravel application.\u003c/p\u003e\n\n[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me-button-s.svg?raw=true)](https://github.com/sponsors/overtrue)\n\n## Installing\n\n```shell\n$ composer require overtrue/laravel-query-logger -vvv\n```\n\nLaravel Query Logger will be enabled when `LOG_QUERY` is `true`.\n\n## Usage\n\n```shell\n$ tail -f ./storage/logs/laravel.log\n```\n\n    [2017-09-05 14:52:14] local.DEBUG: [800μs] select count(*) as aggregate from `discussions` where `discussions`.`deleted_at` is null | GET: http://laravel.app/discussions\n    [2017-09-05 14:52:14] local.DEBUG: [1.07ms] select * from `discussions` where `discussions`.`deleted_at` is null order by `is_top` desc, `created_at` desc limit 15 offset 0 | GET: http://laravel.app/discussions\n    [2017-09-05 14:52:14] local.DEBUG: [3.63s] select `tags`.*, `taggables`.`taggable_id` as `pivot_taggable_id`, `taggables`.`tag_id` as `pivot_tag_id` from `tags` inner join `taggables` on `tags`.`id` = `taggables`.`tag_id` where `taggables`.`taggable_id` in ('1', '2', '3', '4', '5', '6', '7', '8') and `taggables`.`taggable_type` = 'App\\\\Models\\\\Discussion' order by `order_column` asc | GET: http://laravel.app/discussions\n    [2017-09-05 14:52:14] local.DEBUG: [670μs] select * from `users` where `users`.`id` in ('1', '2', '4') and `users`.`deleted_at` is null | GET: http://laravel.app/discussions\n    ...\n    \n### Configuration\n\nYou can also control whether to log a query via the configuration file：\n\n*config/logging.php:*\n\n```php\nreturn [\n    //...\n    'query' =\u003e [\n        'enabled' =\u003e env('LOG_QUERY', env('APP_ENV') === 'local'),\n         \n        // Only record queries that are slower than the following time\n        // Unit: milliseconds\n        'slower_than' =\u003e 0,\n        \n        // Only record queries when the QUERY_LOG_TRIGGER is set in the environment, \n        // or when the trigger HEADER, GET, POST, or COOKIE variable is set.\n        'trigger' =\u003e env('QUERY_LOG_TRIGGER'),\n\n        // Except record queries\n        'except' =\u003e [\n            // '*_telescope_*',\n        ],\n        \n        // Log Channel\n        'channel' =\u003e 'stack',\n    ],\n];\n```\n\n## :heart: Sponsor me \n\n[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me.svg?raw=true)](https://github.com/sponsors/overtrue)\n\n如果你喜欢我的项目并想支持它，[点击这里 :heart:](https://github.com/sponsors/overtrue)\n\n\n## Project supported by JetBrains\n\nMany thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.\n\n[![](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/?from=https://github.com/overtrue)\n\n\n## PHP 扩展包开发\n\n\u003e 想知道如何从零开始构建 PHP 扩展包？\n\u003e\n\u003e 请关注我的实战课程，我会在此课程中分享一些扩展开发经验 —— [《PHP 扩展包实战教程 - 从入门到发布》](https://learnku.com/courses/creating-package)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertrue%2Flaravel-query-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovertrue%2Flaravel-query-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertrue%2Flaravel-query-logger/lists"}