{"id":28352295,"url":"https://github.com/runpod/rplog","last_synced_at":"2025-08-12T21:07:27.134Z","repository":{"id":222546219,"uuid":"753180836","full_name":"runpod/rplog","owner":"runpod","description":"uniform logging for runpod across javascript, python, go.","archived":false,"fork":false,"pushed_at":"2024-02-20T17:33:10.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T08:03:08.235Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/runpod.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":"2024-02-05T16:16:55.000Z","updated_at":"2025-01-27T23:39:03.000Z","dependencies_parsed_at":"2024-02-14T21:30:54.119Z","dependency_job_id":"713830b6-566e-49df-a482-bc1378186d1a","html_url":"https://github.com/runpod/rplog","commit_stats":null,"previous_names":["runpod/rplog"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/runpod/rplog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runpod%2Frplog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runpod%2Frplog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runpod%2Frplog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runpod%2Frplog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/runpod","download_url":"https://codeload.github.com/runpod/rplog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runpod%2Frplog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270135072,"owners_count":24533202,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-05-27T23:06:18.381Z","updated_at":"2025-08-12T21:07:27.091Z","avatar_url":"https://github.com/runpod.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rplog\n\nrplog is runpod's logging and tracing package. It provides a uniform logging implementation across all 3 of Runpod's major languages: Python, JavaScript, and Go. \n\n\n| Language | Subdirectory |\n|----------|--------------|\n| Python | [./py](./py) |\n| JavaScript | [./js](./js) |\n| Go | [./go](./go) |\n\n\nThe following documentation covers language-independent aspects of rplog. For language-specific documentation, see the README in the appropriate subdirectory.\n\n## Overview: Logs\nLogs are written to stderr in JSON format. All logs contain a \"metadata\" field that is a JSON object containing _at least_ the following fields:\n\n| Field | Description | Example |\n|-------|-------------| ------- |\n| commit | The (shortened) git commit hash of the code that is running, as though with `git rev-parse --short HEAD` | 86b4b04\n| env | The environment in which the code is running. | prod\n| language_version | The language (python, javascript, go) and version of the code that is running. | go 1.14.2\n| repo_path | The path to the git repository that the code is running from. | runpod/rplog\n| instance_id | A unique identifier for the instance of the code that is running. | fac72470-068a-44a3-be0d-a43fd9c7fffd\n| service_start | The time at which rplog was initialized. | 2020-06-01T00:00:00Z\n| service_version | The version of the code that is running. This should line up with the git tag. | v0.0.1\n| service_name | The name of the service that is running. | ai-api\n\n\n### Log Levels\n\nWe provide 4 log levels:\n\n| Level | Description | Example |\n|-------|-------------| ------- |\n| DEBUG | Verbose messages, disabled by default in both dev and prod. | \"GET /api/v1/health\" OK\"\n| INFO | Indications of normal operation, enabled by default in dev, disabled by default in prod. | \"Starting server on port 8080\"\n| WARN | Indications of possible issues, missing but not critical data, etc. Enabled by default in both dev and prod. | \"network storage cache disabled\"\n| ERROR | Indications of critical issues, missing critical data, etc. Enabled by default in both dev and prod. | \"failed to connect to database\"\n\n\nGenerally speaking, `WARN` is to be avoided. If you're logging a warning, you should probably be logging an `ERROR` instead. `DEBUG` should be used sparingly, and `INFO` should be used for anything that is not an error.\n\n\n### Populating your logs with metadata via the `buildmeta` tool\n\nWe provide a command-line tool, [buildmeta](./go/cmd/README.md), to populate your logs with metadata. The [releases page](https://github.com/runpod/rplog/releases/) will contain pre-built binaries ready for use: pick the appropriate binary for your platform and put it in your `PATH`.\n\n| OS | ARCH | Binary | Notes |\n|----|------|--------| ------- |\n| Linux or WSL | amd64 | buildmeta_amd64_linux | you probably want this |\n| macOS | amd64 | buildmeta_amd64_darwin | older intel macs|\n| macOS | arm64 | buildmeta_arm64_darwin | newer apple silicon macs |\n| Windows (not WSL) | amd64 | buildmeta_amd64_windows.exe | you probably don't want this |\n\nSee the [buildmeta README](./go/cmd/README.md) for information on how to populate your logs with metadata. In short, you should run `buildmeta` as part of your deployment process to inject the build-time metadata into your application, either by generating a `.py` or `.js` file at 'compile time', or by writing a JSON or environment file to disk that's read at runtime.\n\n### Logs: Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| RUNPOD_LOG_LEVEL | The minimum log level to display. | INFO |\n| ENV | The environment in which the code is running. | unknown |\n| RUNPOD_SERVICE_NAME | The name of the service that is running. | unknown |\n| RUNPOD_SERVICE_VERSION | The version of the service that is running. | unknown |\n| RUNPOD_SERVICE_COMMIT_HASH | The git commit hash of the code that is running. | unknown |\n\n## Timestamps:\nAll timestamps should be RFC3339 in UTC, a subset of ISO8601. For example: `2020-06-01T00:00:00Z`. \n\n\n## Tracing\nTraces consist of a `request_id`, a `trace_id`, and the `trace_start` timestamp. A `trace_id` should begin when an \"event\" starts in our system (i.e, a customer request comes in, a cron job starts, etc) and travels across services. A `request_id` is a unique identifier for a single request: i.e, within the bounds of a single service. A trace may outlive a request, but a request will always be part of a trace.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunpod%2Frplog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunpod%2Frplog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunpod%2Frplog/lists"}