{"id":11800054,"name":"github.com/go-spring/log","ecosystem":"go","description":"Package log is a high-performance and extensible logging library designed specifically for the Go programming\nlanguage. It provides flexible and structured logging capabilities, including context field extraction, multi-level\nlogging configuration, and multiple output options, making it ideal for server-side applications.\n\n## Core Concepts:\n\nTags:\n\nTags are a core concept in the log package used to categorize logs. By registering a tag via the `RegisterTag`\nfunction, you can use regular expressions to match the user-defined tags. This approach allows for a unified API\nfor logging without explicitly creating logger instances. Even third-party libraries can write logs without\nsetting up a logger object.\n\nLoggers:\n\nA Logger is the object that actually handles the logging process. You can obtain a logger instance using the\n`GetLogger` function, which is mainly provided for compatibility with legacy projects. This allows you to\ndirectly retrieve a logger by its name and log pre-formatted messages using the `Write` function.\n\nContext Field Extraction:\n\nContextual data can be extracted and included in log entries via configurable functions:\n- `log.StringFromContext`: Extracts a string value (e.g., a request ID) from the context.\n- `log.FieldsFromContext`: Returns a list of structured fields from the context, such as trace IDs or user IDs.\n\nConfiguration from File:\n\nThe `log.RefreshFile` function allows loading the logger's configuration from an external file (e.g., XML or JSON).\n\nLogger Initialization and Logging:\n\n- Using `GetLogger`, you can fetch a logger instance (often for compatibility with older systems).\n- You can also register custom tags using `RegisterTag` to classify logs according to your needs.\n\nLogging Messages:\n\nThe package provides various logging functions, such as `Tracef`, `Debugf`, `Infof`, `Warnf`, etc.,\nwhich log messages at different levels (e.g., Trace, Debug, Info, Warn).\nThese functions can either accept structured fields or formatted messages.\n\nStructured Logging:\n\nThe logger also supports structured logging, where fields are captured as key-value pairs and logged with the message.\nThe fields can be provided directly in the log functions or through a map.\n\n## Examples:\n\nUsing a pre-registered tag:\n\nUsing structured fields:","homepage":"https://github.com/go-spring/log","licenses":"Apache-2.0","normalized_licenses":["Apache-2.0"],"repository_url":"https://github.com/go-spring/log","keywords_array":[],"namespace":"github.com/go-spring","versions_count":12,"first_release_published_at":"2025-06-13T14:09:22.000Z","latest_release_published_at":"2025-10-01T03:10:29.000Z","latest_release_number":"v0.0.12","last_synced_at":"2026-07-29T22:03:17.568Z","created_at":"2025-06-14T10:52:22.355Z","updated_at":"2026-10-05T10:34:41.129Z","registry_url":"https://pkg.go.dev/github.com/go-spring/log","install_command":"go get github.com/go-spring/log","documentation_url":"https://pkg.go.dev/github.com/go-spring/log#section-documentation","metadata":{},"repo_metadata":{"id":298900011,"uuid":"1001276102","full_name":"go-spring-rip/log","owner":"go-spring-rip","description":"🔥 [released] A high-performance, tag-based structured logging system with a self4j-inspired architecture.","archived":true,"fork":false,"pushed_at":"2026-06-11T02:05:47.000Z","size":333,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-08-06T16:53:35.982Z","etag":null,"topics":["log","log4j2","slf4j","slog"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-spring-rip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-13T05:42:17.000Z","updated_at":"2026-06-12T09:46:27.000Z","dependencies_parsed_at":"2026-01-16T05:09:55.001Z","dependency_job_id":null,"html_url":"https://github.com/go-spring-rip/log","commit_stats":null,"previous_names":["go-spring/log"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/go-spring-rip/log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-spring-rip%2Flog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-spring-rip%2Flog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-spring-rip%2Flog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-spring-rip%2Flog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-spring-rip","download_url":"https://codeload.github.com/go-spring-rip/log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-spring-rip%2Flog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":343170754,"owners_count":38035142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-05T02:00:06.766Z","response_time":83,"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"},"owner_record":{"login":"go-spring","name":"go-spring","uuid":"55130341","kind":"organization","description":null,"email":null,"website":null,"location":null,"twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/55130341?v=4","repositories_count":58,"last_synced_at":"2025-03-30T08:01:47.751Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/go-spring","funding_links":[],"total_stars":1666,"followers":30,"following":0,"created_at":"2022-11-15T03:46:09.886Z","updated_at":"2025-03-30T08:01:47.751Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-spring","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-spring/repositories"},"tags":[]},"repo_metadata_updated_at":"2026-10-05T10:34:41.128Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":5.71297711695958,"dependent_packages_count":5.353648987207386,"stargazers_count":null,"forks_count":null,"docker_downloads_count":null,"average":5.533313052083483},"purl":"pkg:golang/github.com/go-spring/log","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/go/github.com/go-spring/log","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/go/github.com/go-spring/log","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/go/github.com/go-spring/log/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2025-08-04T05:44:31.081Z","issues_count":0,"pull_requests_count":0,"avg_time_to_close_issue":null,"avg_time_to_close_pull_request":null,"issues_closed_count":0,"pull_requests_closed_count":0,"pull_request_authors_count":0,"issue_authors_count":0,"avg_comments_per_issue":null,"avg_comments_per_pull_request":null,"merged_pull_requests_count":0,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":0,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":0,"past_year_pull_request_authors_count":0,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":null,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":0,"issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-spring%2Flog/issues","maintainers":[],"active_maintainers":[]},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-spring%2Flog/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-spring%2Flog/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-spring%2Flog/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-spring%2Flog/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-spring%2Flog/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-spring%2Flog/codemeta","maintainers":[]}