{"id":20389977,"url":"https://github.com/imskully/pm2-papertrail-logger","last_synced_at":"2025-04-12T11:11:19.761Z","repository":{"id":187337398,"uuid":"676733119","full_name":"ImSkully/pm2-papertrail-logger","owner":"ImSkully","description":"A simple and efficient PM2 module that forwards logs to Papertrail.","archived":false,"fork":false,"pushed_at":"2024-07-02T00:31:30.000Z","size":242,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T05:51:12.956Z","etag":null,"topics":["hacktoberfest","papertrail","pm2","pm2-module"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ImSkully.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ImSkully","buy_me_a_coffee":"Skully"}},"created_at":"2023-08-09T22:11:37.000Z","updated_at":"2024-10-25T00:22:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3e6dde5-8e86-4a88-81b9-afc0ffc7de7e","html_url":"https://github.com/ImSkully/pm2-papertrail-logger","commit_stats":null,"previous_names":["imskully/pm2-papertrail-logger"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImSkully%2Fpm2-papertrail-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImSkully%2Fpm2-papertrail-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImSkully%2Fpm2-papertrail-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImSkully%2Fpm2-papertrail-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ImSkully","download_url":"https://codeload.github.com/ImSkully/pm2-papertrail-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248557844,"owners_count":21124168,"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":["hacktoberfest","papertrail","pm2","pm2-module"],"created_at":"2024-11-15T03:20:44.929Z","updated_at":"2025-04-12T11:11:19.756Z","avatar_url":"https://github.com/ImSkully.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ImSkully","https://buymeacoffee.com/Skully"],"categories":[],"sub_categories":[],"readme":"# PM2 Papertrail Logger \u003ca href=\"https://pm2.keymetrics.io\" target=\"_blank\" alt=\"pm2\"\u003e\u003cimg src=\"https://img.shields.io/badge/pm2-2B037A.svg?logo=pm2\" /\u003e\u003c/a\u003e \u003ca href=\"https://papertrailapp.com\" target=\"_blank\" alt=\"Papertrail\"\u003e\u003cimg src=\"https://img.shields.io/badge/Papertrail-04498f.svg?logo=data:image/svg%2bxml;base64,PHN2ZyBoZWlnaHQ9IjI4IiB2aWV3Qm94PSIwIDAgMzUgMjgiIHdpZHRoPSIzNSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMTYuNjYyIDEzLjEzLjAwMy4wMTdjLTEuNTkuNDItMy4xOTguNzcyLTQuNzc1IDEuMjU5YTIwLjk4IDIwLjk4IDAgMCAwIC0xMS44MTUtNS4yOCAzOC40MDUgMzguNDA1IDAgMCAxIDIyLjI4My03LjIxN2wtMi43NDggMi41MThzMTEuNjQ0LS40MTcgMTQuNTgtNC40MjdhNS4zNzcgNS4zNzcgMCAwIDEgLS4zNzggMS4yMTUgMTMuMTIgMTMuMTIgMCAwIDEgLTQuMjM4IDUuOTg1IDI0LjI2NSAyNC4yNjUgMCAwIDEgLTYuMDQyIDMuNDQxIDU3Ljg3NCA1Ny44NzQgMCAwIDEgLTYuNTY2IDIuNDA0bC0uMzA0LjA4NHptMTguMjYzLS4zOTZjLTQuMjIuNTg4LTEyLjM1MiA0Ljc2Mi0xOC4yMTggOC4wMzFhMjEuMTA1IDIxLjEwNSAwIDAgMCAtMy42ODQtNS4yNTdjMTEuMTU3LTMuNjEzIDIxLjkwMi0yLjc3NCAyMS45MDItMi43NzR6bS0xNy40ODQgOS43MDYgMTEuNTU2LTQuOTYtMTAuMjI3IDEwLjUyYTIwLjkzOCAyMC45MzggMCAwIDAgLTEuMzMtNS41NnoiIGZpbGw9IiNmZmExMDAiIGRhdGEtZGFya3JlYWRlci1pbmxpbmUtZmlsbD0iIiBzdHlsZT0iLS1kYXJrcmVhZGVyLWlubGluZS1maWxsOiAjY2M4MTAwOyI+PC9wYXRoPjwvc3ZnPg==\" /\u003e\u003c/a\u003e\n\n![Maintained](https://img.shields.io/maintenance/yes/2024.svg)\n\u003ca href=\"https://nodejs.org\" target=\"_blank\" alt=\"Node.js\"\u003e\u003cimg src=\"https://img.shields.io/badge/Node.js-6DA55F?style=flat\u0026logo=node.js\u0026logoColor=white\" /\u003e\u003c/a\u003e\n![License](https://img.shields.io/github/license/ImSkully/pm2-papertrail-logger)\n\u003ca href=\"./package-lock.json\" target=\"_blank\" alt=\"package-lock\"\u003e\u003cimg src=\"https://img.shields.io/badge/package--lock-committed-brightgreen\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/pm2-papertrail-logger\" target=\"_blank\" alt=\"npmjs Package\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/pm2-papertrail-logger.svg\" /\u003e\u003c/a\u003e\n\nA simple and efficient [PM2](https://pm2.keymetrics.io) module that forwards logs for all your PM2 processes to [Papertrail](https://papertrailapp.com):\n\n* ⚡️ Fast and lightweight, unpacked size of 54kb!\n* 🔒 Secure with all logs sent over TLS\n* 🔧 Easy to install and configure, deployed with 3 easy commands within a matter of seconds!\n* 📝 Adjustable hostname for your pm2 source\n* 🚀 Supports all PM2 process modes, including cluster, fork, and standalone.\n* 📦 Memory management and automatic cleanup for closed processes\n\n# Prerequisites\n\n### PM2\nThis module requires that you have [PM2](https://pm2.keymetrics.io) installed and running on your system. If you do not have PM2 installed, you can install it via NPM:\n```bash\nnpm install pm2 -g\n```\n\n### Papertrail\nIn order to use this module and forward all your pm2 process logs, you must have a [Papertrail](https://papertrailapp.com) Standalone account, this will not work for Papertrail instances that are attached as an addon to a Heroku application. For information on setting up a Papertrail Standalone account, [click here](https://www.papertrail.com/help/heroku/).\n\nWithin your Papertrail account, you will need a [Log Destination](https://papertrailapp.com/account/destinations) that accepts connections via TCP/UDP Ports. Once this is setup, take note of your destination host *(\\*.papertrailapp.com)* and port number.\n\n# Installation \u0026 Setup\n1. Install the module via `pm2`:\n  ```bash\n  pm2 install pm2-papertrail-logger\n  ```\n  \u003e [!IMPORTANT]  \n  \u003e Use `pm2 install`, not `npm install`!\n\n2. Configure the Papertrail log destination by providing your host and port number:\n  ```bash\n  pm2 set pm2-papertrail-logger:host \u003chost\u003e\n  pm2 set pm2-papertrail-logger:port \u003cport\u003e\n  ```\n\n3. The module should restart and begin logging to Papertrail!\n\n# Usage\nOnce the module is installed and configured, it will automatically begin logging all your PM2 processes to Papertrail. You can view the logs by clicking on the [`Events`](https://my.papertrailapp.com/events) tab within your Papertrail account.\n\n### Change Hostname\nBy default, the host name sent to Papertrail will be the OS hostname, you can change this by setting the hostname configuration variable:\n```bash\npm2 set pm2-papertrail-logger:hostname \u003chostname\u003e\n```\n\n### Process as Systems\nIf you would like to have each PM2 process be created as its own system group within Papertrail, you can set the `process-as-systems` configuration to `true`:\n```bash\npm2 set pm2-papertrail-logger:process-as-systems true\n```\n\n### Blacklist\nTo prevent certain PM2 processes from being logged to Papertrail, you can set a blacklist of process names in the `blacklist` configuration variable which is a comma-separated list of process names:\n```bash\npm2 set pm2-papertrail-logger:blacklist \"process1,process2\"\n```\n\n### PM2 Metrics\nThis module also provides metrics that can be viewed within the PM2 dashboard.\n| Metric | Description |\n| --- | --- |\n| `Attached Processes` | The number of processes that are currently transporting logs to Papertrail. |\n\n# Uninstalling\nTo uninstall the module, simply run:\n```bash\npm2 uninstall pm2-papertrail-logger\n```\n\nThis will remove the module from your PM2 configuration and stop it from running, you may also want to remove the configuration variables that were set:\n```bash\npm2 unset pm2-papertrail-logger:host\npm2 unset pm2-papertrail-logger:port\npm2 unset pm2-papertrail-logger:hostname\npm2 unset pm2-papertrail-logger:process-as-systems\npm2 unset pm2-papertrail-logger:blacklist\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimskully%2Fpm2-papertrail-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimskully%2Fpm2-papertrail-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimskully%2Fpm2-papertrail-logger/lists"}