{"id":15371654,"url":"https://github.com/joshcanhelp/logcloud","last_synced_at":"2026-04-20T03:07:42.912Z","repository":{"id":162338058,"uuid":"636899969","full_name":"joshcanhelp/logcloud","owner":"joshcanhelp","description":"Or is it cloudlog? CLOG!","archived":false,"fork":false,"pushed_at":"2023-05-18T17:59:24.000Z","size":191,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T10:59:33.459Z","etag":null,"topics":["fastify","logging","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"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/joshcanhelp.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2023-05-05T23:32:35.000Z","updated_at":"2024-02-29T01:26:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"45dff9aa-78fa-4cc3-b50c-8ee75abf0cb8","html_url":"https://github.com/joshcanhelp/logcloud","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"443935051cebdccb6e099a53f7c00f412caea742"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshcanhelp%2Flogcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshcanhelp%2Flogcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshcanhelp%2Flogcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshcanhelp%2Flogcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshcanhelp","download_url":"https://codeload.github.com/joshcanhelp/logcloud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245931745,"owners_count":20695958,"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":["fastify","logging","nodejs"],"created_at":"2024-10-01T13:48:22.208Z","updated_at":"2026-04-20T03:07:37.885Z","avatar_url":"https://github.com/joshcanhelp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloud Log Router\n\nThis little guy accepts incoming log events and sends them to another service.\n\n## Setup\n\nInstall dependencies:\n\n```bash\n$ npm install\n```\n\nCreate an env file:\n\n```bash\n$ cp example.env .env\n```\n\nGenerate an API key:\n\n```bash\n$ openssl rand -hex 16\n569bcb828398cd03b0ce3715eb135fa3\n```\n\nAdd that to the `API_KEY` in the env file.\n\nStart the service:\n\n```bash\n$ npm start\n```\n\nPost a log event:\n\n```bash\n$ curl -i \\\n-d '{\"actor\":\"Auth0 Tenant\",\"component\":\"Actions\",\"text\":\"This is an event that happened\",\"transaction\":\"12313234534\",\"level\":\"fatal\"}' \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer f588536b232da287969b25e0fa5595b8\" \\\nhttp://localhost:3000/log\n```\n\nYou should see output in the application log:\n\n```js\n{\n  actor: 'Auth0 Tenant',\n  component: 'Actions',\n  text: 'This is an event that happened',\n  transaction: '12313234534',\n  level: 'fatal'\n}\n```\n\n**To send logs to memory:**\n\n1. Uncomment the memory `OUTBOUND` var in the env file and adjust `MAX_LOGS_IN_MEMORY` as needed\n2. Run processes that generate logs as usual\n3. Make a `GET` call to the `/log` endpoint with an API key to see all the logs in memory.\n4. Make a `GET` call to the `/log/{$transaction}` endpoint with an API key to see logs for a specific transaction.\n5. Make a `DELETE` call to the `/log` endpoint with an API key to flush all saved logs.\n\n**To send logs to Slack:**\n\n1. [Create a Slack app with a WebHook URL](https://api.slack.com/messaging/webhooks).\n2. Uncomment the Slack lines in the env file and add your URL.\n3. Restart the application and post a log event like the example above.\n\n![](./docs/slack-example.png)\n\n**To send logs to a Google Sheet:**\n\n1. [Create a Google Service account](https://cloud.google.com/iam/docs/service-accounts-create#creating).\n2. [Generate and download credentials for the service account](https://cloud.google.com/iam/docs/keys-create-delete).\n3. Copy or move the credentials to a `.google.json` file in the root of the application.\n4. [Enable the Sheets API](https://cloud.google.com/apis/docs/getting-started#enabling_apis).\n5. Create a new Google Sheet and share it with the `client_email` address in the credentials.\n6. Uncomment the Google lines in the env file and add your Sheet ID; comment out any other `OUTBOUND` lines.\n7. Restart the application and post a log event like the example above.\n8. The Google Sheet should be appended with a new row with:\n   - Date and time (UTC)\n   - Event type\n   - Actor + component\n   - Event message\n   - Transaction\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshcanhelp%2Flogcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshcanhelp%2Flogcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshcanhelp%2Flogcloud/lists"}