{"id":13805752,"url":"https://github.com/phalcon-orphanage/phalcon-logentries","last_synced_at":"2026-01-11T06:55:01.819Z","repository":{"id":36716204,"uuid":"41022770","full_name":"phalcon-orphanage/phalcon-logentries","owner":"phalcon-orphanage","description":"Sends log messages to the Logentries log management service","archived":false,"fork":false,"pushed_at":"2017-04-11T05:57:11.000Z","size":42,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-10T05:45:16.771Z","etag":null,"topics":["adapter","logentries","logs","phalcon","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"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/phalcon-orphanage.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}},"created_at":"2015-08-19T08:37:30.000Z","updated_at":"2019-04-15T17:46:56.000Z","dependencies_parsed_at":"2022-08-24T22:30:25.242Z","dependency_job_id":null,"html_url":"https://github.com/phalcon-orphanage/phalcon-logentries","commit_stats":null,"previous_names":["phalcon/phalcon-logentries"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon-orphanage%2Fphalcon-logentries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon-orphanage%2Fphalcon-logentries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon-orphanage%2Fphalcon-logentries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon-orphanage%2Fphalcon-logentries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phalcon-orphanage","download_url":"https://codeload.github.com/phalcon-orphanage/phalcon-logentries/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254030975,"owners_count":22002681,"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":["adapter","logentries","logs","phalcon","php"],"created_at":"2024-08-04T01:01:04.511Z","updated_at":"2026-01-11T06:55:01.814Z","avatar_url":"https://github.com/phalcon-orphanage.png","language":"PHP","funding_links":[],"categories":["Integration"],"sub_categories":[],"readme":"# Phalcon Logentries\n\n[![Software License](https://img.shields.io/badge/license-BSD--3-brightgreen.svg?style=flat-square)](https://github.com/phalcon/phalcon-logentries/blob/master/LICENSE.txt)\n[![Build Status](https://img.shields.io/travis/phalcon/phalcon-logentries/master.svg?style=flat-square)](https://travis-ci.org/phalcon/phalcon-logentries)\n[![Total Downloads](https://img.shields.io/packagist/dt/phalcon/logentries.svg?style=flat-square)](https://packagist.org/packages/phalcon/logentries)\n\nPhalcon library to connect and make log entries using [Logentries][1].\nYou can adapt it to your own needs or improve it if you want.\n\nPlease write us if you have any feedback.\n\nThanks.\n\n## NOTE\n\nThe master branch will always contain the latest stable version. If you wish\nto check older versions or newer ones currently under development, please\nswitch to the relevant branch.\n\n## Get Started\n\n### Requirements\n\nTo use this library on your machine, you need at least:\n\n* [Composer][2]\n* PHP \u003e= 5.5\n* Latest stable [Phalcon Framework release][3] extension enabled\n\nDevelopment requirements:\n\n* [Codeception][4]\n* [PHP_CodeSniffer][5]\n\n### Installation\n\nInstall composer in a common location or in your project:\n\n```sh\n$ curl -s http://getcomposer.org/installer | php\n```\n\nCreate the composer.json file as follows:\n\n```json\n{\n    \"require\": {\n        \"phalcon/logentries\": \"~1.2\"\n    }\n}\n```\n\nRun the composer installer:\n\n```sh\n$ php composer.phar install\n```\n\n## Setup\n\nWhen you have made your account on Logentries. Log in and create a new host with a name that best represents your app.\nThen, click on your new host and inside that, create a new log file with a name that represents what you are logging,\nexample: `myerrors`. Bear in mind, these names are purely for your own benefit. Under source type, select Token TCP\nand click Register. You will notice a token appear beside the name of the log, these is a unique identifier that the logging\nlibrary will use to access that logfile. You can copy and paste this now or later.\n\nThen create adapter instance:\n\n```php\nuse Phalcon\\Logger\\Adapter\\Logentries;\n\n$di-\u003eset('logger', function() {\n    $logger = new Logentries([\n        'token' =\u003e getenv('LOGENTRIES_TOKEN'),\n        // optional parameters\n    ]);\n    \n    return $logger;\n});\n```\n\n`LOGENTRIES_TOKEN` is the token we copied earlier from the Logentries UI.\nIt associates that logger with the log file on Logentries.\n\n### Adding a Custom Host Name and Host ID sent in your PHP log events\n\nTo Set a custom host name that will appear in your PHP log events as Key / Value pairs\npass to the `Logentries::__constructor` the following parameters:\n\n- **host_name_enabled**\n- **host_name**\n- **host_id**\n\nFor example:\n\n```php\nuse Phalcon\\Logger\\Adapter\\Logentries;\n\n$di-\u003eset('logger', function() {\n    $logger = new Logentries([\n        'token'             =\u003e getenv('LOGENTRIES_TOKEN'),\n        'host_name_enabled' =\u003e true,\n        'host_name'         =\u003e 'Custom_host_name_here',\n        'host_id'           =\u003e 'Custom_ID_here_12345'\n    ]);\n\n    return $logger;\n});\n```\n\nThe `host_name` param can be left as an empty string, and the Logentries component will automatically attempt to\nassign a host name from your local host machine and use that as the custom host name.\n\nTo set a custom Host ID that will appear in your PHP log events as Key / Value pairs:\n* Enter a value instead of the empty string in `host_id =\u003e ''`;\n* If no `host_id` is set and the empty string is left unaltered, no Host ID or Key / Value pairing will appear in your PHP logs.\n\n## Creating a Log\n\nThe example below shows how to create a log and add messages to it:\n\n```php\nuse Phalcon\\Logger;\nuse Phalcon\\Logger\\Adapter\\Logentries as LeAdapter;\n\n$logger = new LeAdapter(['token' =\u003e 'ad43g-dfd34-df3ed-3d3d3']);\n\n// These are the different log levels available:\n$logger-\u003ecritical('This is a critical message');\n$logger-\u003eemergency('This is an emergency message');\n$logger-\u003edebug('This is a debug message');\n$logger-\u003eerror('This is an error message');\n$logger-\u003einfo('This is an info message');\n$logger-\u003enotice('This is a notice message');\n$logger-\u003ewarning('This is a warning message');\n$logger-\u003ealert('This is an alert message');\n\n\n// You can also use the log() method with a Logger constant:\n$logger-\u003elog('This is another error message', Logger::ERROR);\n\n// If no constant is given, DEBUG is assumed.\n$logger-\u003elog('This is a message');\n\n// Closes the logger\n$logger-\u003eclose();\n```\n\n## Tests\n\nPhosphorum use [Codeception][4] unit test.\n\nFirst you need to re-generate base classes for all suites:\n\n```bash\n$ vendor/bin/codecept build\n```\n\nExecute all test with `run` command:\n\n```bash\n$ vendor/bin/codecept run\n# OR\n$ vendor/bin/codecept run --debug # Detailed output\n```\n\nMore details about Console Commands see [here][6].\n\n## License\n\nPhalcon Logentries is open-sourced software licensed under the [New BSD License][7].\n© Phalcon Framework Team and contributors\n\n[1]: https://logentries.com/\n[2]: https://getcomposer.org/\n[3]: https://github.com/phalcon/cphalcon/releases\n[4]: http://codeception.com/\n[5]: https://github.com/squizlabs/PHP_CodeSniffer\n[6]: http://codeception.com/docs/reference/Commands\n[7]: https://github.com/phalcon/phalcon-logentries/blob/master/LICENSE.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalcon-orphanage%2Fphalcon-logentries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphalcon-orphanage%2Fphalcon-logentries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalcon-orphanage%2Fphalcon-logentries/lists"}