{"id":37016877,"url":"https://github.com/ankurcha/gcloud-logging-slf4j-logback","last_synced_at":"2026-01-14T01:55:51.968Z","repository":{"id":51711931,"uuid":"72702734","full_name":"ankurcha/gcloud-logging-slf4j-logback","owner":"ankurcha","description":"gcloud-logging json log appender for sl4j + logback","archived":false,"fork":false,"pushed_at":"2021-06-21T17:42:03.000Z","size":107,"stargazers_count":32,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-24T11:59:16.438Z","etag":null,"topics":["google-cloud-logging","json","sl4j-logback"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ankurcha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-03T02:52:08.000Z","updated_at":"2022-11-13T18:14:19.000Z","dependencies_parsed_at":"2022-08-03T10:45:20.874Z","dependency_job_id":null,"html_url":"https://github.com/ankurcha/gcloud-logging-slf4j-logback","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/ankurcha/gcloud-logging-slf4j-logback","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankurcha%2Fgcloud-logging-slf4j-logback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankurcha%2Fgcloud-logging-slf4j-logback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankurcha%2Fgcloud-logging-slf4j-logback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankurcha%2Fgcloud-logging-slf4j-logback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ankurcha","download_url":"https://codeload.github.com/ankurcha/gcloud-logging-slf4j-logback/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankurcha%2Fgcloud-logging-slf4j-logback/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["google-cloud-logging","json","sl4j-logback"],"created_at":"2026-01-14T01:55:48.748Z","updated_at":"2026-01-14T01:55:51.963Z","avatar_url":"https://github.com/ankurcha.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gcloud-logging json log appender for sl4j + logback\n[![Build Status](https://travis-ci.org/ankurcha/gcloud-logging-slf4j-logback.svg?branch=master)](https://travis-ci.org/ankurcha/gcloud-logging-slf4j-logback)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.ankurcha/google-cloud-logging-logback-slf4j/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.ankurcha/google-cloud-logging-logback-slf4j)\n\n\nThis library provides a simple json based layout that can be used to send structured logs to gcloud logging.\n\nThis appender is particularly useful in [Google Container Engine](https://cloud.google.com/container-engine/)\nwhere logs should be emitted to stdout.\n\nStackdriver fluentd plugin implementation\n\nhttps://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/blob/master/lib/fluent/plugin/out_google_cloud.rb\n\n## Is this production ready?\n\nYes.\n\n## Usage\n\nAdd dependency to `build.gradle`:\n\n```groovy\ndependencies {\n    // refer to badge for latest version\n    compile 'com.github.ankurcha:google-cloud-logging-logback-slf4j:LATEST'\n}\n```\n\nor to maven `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.ankurcha\u003c/groupId\u003e\n    \u003cartifactId\u003egoogle-cloud-logging-logback-slf4j\u003c/artifactId\u003e\n    \u003cversion\u003eLATEST\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAdd entry to `logback.xml`\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cconfiguration\u003e\n    \u003cappender name=\"KUBE_CONSOLE\" class=\"ch.qos.logback.core.ConsoleAppender\"\u003e\n        \u003cencoder class=\"ch.qos.logback.core.encoder.LayoutWrappingEncoder\"\u003e\n            \u003clayout class=\"com.google.cloud.logging.GoogleCloudLoggingV2Layout\"\u003e\n                \u003cappendLineSeparator\u003etrue\u003c/appendLineSeparator\u003e\n                \u003cserviceName\u003e@service-name@\u003c/serviceName\u003e\n                \u003cserviceVersion\u003e@git.sha@\u003c/serviceVersion\u003e\n                \u003cjsonFormatter class=\"com.google.cloud.logging.GSONJsonFormatter\"/\u003e\n            \u003c/layout\u003e\n        \u003c/encoder\u003e\n    \u003c/appender\u003e\n\n    \u003croot level=\"info\"\u003e\n        \u003cappender-ref ref=\"KUBE_CONSOLE\"/\u003e\n    \u003c/root\u003e\n\n\u003c/configuration\u003e\n\n```\n\nExample log line (prettified here):\n\n```json\n{\n   \"severity\":\"INFO\",\n   \"logging.googleapis.com/trace\": \"projects/\u003cproject-id\u003e/traces/\u003ctrace_id\u003e\",\n   \"logging.googleapis.com/spanId\": \"\u003cspan_id\u003e\",\n   \"context\":{\n      \"reportLocation\":{\n         \"functionName\":\"org.springframework.web.servlet.FrameworkServlet.initServletBean\",\n         \"filePath\":\"org/springframework/web/servlet/FrameworkServlet.class\",\n         \"logger\":\"org.springframework.web.servlet.DispatcherServlet\",\n         \"thread\":\"http-nio-8080-exec-1\",\n         \"lineNumber\":508\n      }\n   },\n   \"serviceContext\":{\n      \"version\":\"dc23b8d342e95b48a80219a2af67388b1c1a52d0\",\n      \"service\":\"ferric\"\n   },\n   \"message\":\"FrameworkServlet \\u0027dispatcherServlet\\u0027: initialization completed in 27 ms\",\n   \"timestamp\":{\n      \"seconds\":1478201184,\n      \"nanos\":753000000\n   }\n}\n```\n\n## Adding trace context (since 1.1.7)\n\nAdd an argument to the log statement of type `com.google.cloud.logging.TraceContext` with trace and spanId if available.\nTrace id should be of the format: `projects/\u003cproject-id\u003e/traces/\u003ctrace_id\u003e` where `project-id` is the gcp project id and\n`trace_id` is the 16-character hexadecimal encoding of the trace id. Similarly for the `\u003cspan-id\u003e`.\n\n## Adding http request context (since 1.1.8)\n\nAdd an argument to the log statement of type `com.google.cloud.logging.HttpRequestContext` to provide the `httpRequest` fields.\nThis field will be emitted as the `httpRequest` field in the output.\n\n## Source location (since 1.1.9)\n\nThe source location is now populated as the `logging.googleapis.com/sourceLocation` field when available.\n\n## TODO\n\n* [x] Update in readme\n* [ ] Add some tests for the formatter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankurcha%2Fgcloud-logging-slf4j-logback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankurcha%2Fgcloud-logging-slf4j-logback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankurcha%2Fgcloud-logging-slf4j-logback/lists"}