{"id":20710443,"url":"https://github.com/mobiletelesystems/logs","last_synced_at":"2025-09-27T11:30:23.111Z","repository":{"id":91738120,"uuid":"582606942","full_name":"MobileTeleSystems/logs","owner":"MobileTeleSystems","description":"Microservice for translate browser logs to server side logs systems, ex: ELK.","archived":false,"fork":false,"pushed_at":"2024-11-22T20:07:04.000Z","size":640,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-24T23:34:51.631Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/MobileTeleSystems.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-27T10:50:49.000Z","updated_at":"2024-10-19T14:11:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"c464d2a8-cf4f-443d-8352-16de54875b22","html_url":"https://github.com/MobileTeleSystems/logs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Flogs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Flogs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Flogs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Flogs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MobileTeleSystems","download_url":"https://codeload.github.com/MobileTeleSystems/logs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234429245,"owners_count":18831240,"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":[],"created_at":"2024-11-17T02:11:59.828Z","updated_at":"2025-09-27T11:30:23.105Z","avatar_url":"https://github.com/MobileTeleSystems.png","language":"TypeScript","readme":"\n# Microservice for translating browser logs to server-side log systems, e.g. ELK\n\nThe microservice provides an API that accepts any JSON object from the browser and outputs it to the container's stdout. The container configuration should have a [Logging Driver](https://docs.docker.com/config/containers/logging/configure/#configure-the-logging-driver-for-a-container) setting that will read the stdout and pass it to your log aggregation system.\n\nFeatures:\n\n- Allows you to collect logs from the browser using server-side logging tools\n- Does not limit your choice of server logging tool—use any\n- Includes a metrics exporter for Prometheus\n\n\n## Try\n\nTo try the microservice features, run the container with the command:\n\n```sh\ndocker run -it --rm -p 3000:3000 mtsrus/logs\n```\n\n\nNow you can check the work with the command:\n\n\n```sh\ncurl -d '{\"message\": \"Sample log\"}' -H \"Content-Type: application/json\" -X POST http://localhost:3000/log/log\n```\n\n\nJSON should be displayed in the container console. This JSON will be read by the Logging Driver and sent to the logging system.\n\n\n## Use\n\nTo start the microservice in production, use the command:\n\n```sh\ndocker run -d --restart always -p 3000:3000 mtsrus/logs\n```\n\n\n## Endpoints\n\nAll endpoints use the POST request method and accept a JSON object as the request body.\n\n- `/log/log` - info level log\n- `/log/warn` - warning level log\n- `/log/error` - error level log\n- `/log/debug` - debug level log\n- `/log/verbose` - verbose/trace level log\n\n\n## Prometheus Metrics\n\nThe microservice has built-in Prometheus monitoring available at the `/metrics` endpoint.\n\nBlock this endpoint on your proxy if you do not need to provide access to metrics from outside your network.\n\n\n## Components for Web\n\nYou can use any log collector on the browser side. To send logs to the microservice, you need to write a send function for your logging tool.\n\nExample:\n\n```typescript\nconst log = (message, level, error) =\u003e {\n    fetch(\n        `http://localhost:3000/log/${level}`,\n        {\n            method: \"POST\",\n            headers: { \"Content-Type\": \"application/json\" },\n            body: JSON.stringify({\n                message: message,\n                userAgent: navigator.userAgent,\n                location: location.href,\n                stack: error?.stack\n            })\n        }\n    );\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiletelesystems%2Flogs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobiletelesystems%2Flogs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiletelesystems%2Flogs/lists"}