{"id":22059284,"url":"https://github.com/opentable/otj-logging","last_synced_at":"2025-07-24T00:31:46.010Z","repository":{"id":15191677,"uuid":"17919790","full_name":"opentable/otj-logging","owner":"opentable","description":"OpenTable Java logging configuration component","archived":true,"fork":false,"pushed_at":"2024-05-07T22:42:12.000Z","size":560,"stargazers_count":4,"open_issues_count":1,"forks_count":7,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-07-15T22:59:11.671Z","etag":null,"topics":["jetty","kafka","logging","platform-java"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/opentable.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2014-03-19T20:47:45.000Z","updated_at":"2024-11-24T17:39:06.000Z","dependencies_parsed_at":"2024-05-07T23:30:46.397Z","dependency_job_id":"7bfadc8d-649d-4e53-8195-8a1334272557","html_url":"https://github.com/opentable/otj-logging","commit_stats":null,"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"purl":"pkg:github/opentable/otj-logging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fotj-logging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fotj-logging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fotj-logging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fotj-logging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentable","download_url":"https://codeload.github.com/opentable/otj-logging/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fotj-logging/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266774720,"owners_count":23982246,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["jetty","kafka","logging","platform-java"],"created_at":"2024-11-30T17:27:50.954Z","updated_at":"2025-07-24T00:31:45.598Z","avatar_url":"https://github.com/opentable.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"OpenTable Logging Components\n============================\n\n[![Build Status](https://travis-ci.org/opentable/otj-logging.svg)](https://travis-ci.org/opentable/otj-logging)\n\nComponent Charter\n-----------------\n\n* Manage Logback configuration and integration with other logging APIs.\n* Provide reference implementation of the \n[standard logging format](https://wiki.otcorp.opentable.com:8443/display/CP/Log+Proposals)\n* Provide Appender implementations for OpenTable logging infrastructure\n* Allow logging structured data in addition to traditional String messages\n\notj-logging-core\n----------------\n\nThe Core module provides definitions for the OpenTable common log format.\n\nThe __CommonLogFields__ interface defines the fields that are sent for all logging events.\nThe __HttpLogFields__ interface defines the fields that are sent for HTTP access log events.\nThe __ApplicationLogEvent__ class wraps a Logback logging event and exposes the common log format.\n\nIt also provides a Logback encoder __JsonLogEncoder__ which serializes the above event types\ninto a format suitable to submit to the OpenTable logging infrastructure through an arbitrary Appender.\n\nThe common log format defines a \"servicetype\" field which should be filled with the name of the service.\nAs the logger does not know the name of the service it is running in, this *must* be provided by the application.\nFor applications using our template, the `otj-server` component takes care to set this correctly.\nther applications should explicitly initialize this early on during application initialization:\n\n```java\nCommonLogHolder.setServiceType(\"my-cool-server\");\n```\n\notj-logging-redis\n----------------\n* This component was removed in 2017. All logging on OTJ platform now occurs via Kafka.\n\notj-logging-kafka\n-----------------\n\nThe Kafka module provides an Appender that submits logging events to a Kafka queue.  Example configuration:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" ?\u003e\n\n\u003c!--\n  Example configuration that logs text to the console and JSON to Kafka\n--\u003e\n\u003cconfiguration threshold=\"TRACE\"\u003e\n  \u003cappender name=\"CONSOLE\" class=\"ch.qos.logback.core.ConsoleAppender\"\u003e\n    \u003cencoder\u003e\n      \u003cpattern\u003e%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n\u003c/pattern\u003e\n    \u003c/encoder\u003e\n  \u003c/appender\u003e\n\n  \u003cappender name=\"KAFKA\" class=\"com.opentable.logging.KafkaAppender\"\u003e\n    \u003cencoder class=\"com.opentable.logging.JsonLogEncoder\"/\u003e\n    \u003cbrokerList\u003elocalhost:12345\u003c/brokerList\u003e\n    \u003ctopic\u003elogs\u003c/topic\u003e\n    \u003cclientId\u003emy-application-name\u003c/clientId\u003e\n  \u003c/appender\u003e\n\n  \u003c!-- Default is DEBUG for our stuff, INFO for everything else --\u003e\n  \u003clogger name=\"com.opentable\" level=\"DEBUG\" /\u003e\n\n  \u003croot level=\"INFO\"\u003e\n    \u003cappender-ref ref=\"CONSOLE\" /\u003e\n    \u003cappender-ref ref=\"KAFKA\" /\u003e\n  \u003c/root\u003e\n\u003c/configuration\u003e\n\n```\n\notj-logging-bucket\n-----------\nPerhaps you need to rate limit or sample your logging? We've got a module for you.\n\nImport `otj-logging-bucket` as a dependency and use either of these implementations as a decorator\nfor your SLF4J Logger.\n\n* `BucketLog` - Uses a token bucket to rate limit. There are several static methods you can use. Here's an\nexample\n\n```\n    private static final Logger LOG = BucketLog.of(MyClass.class, 10); // 10 per second\n```\n\n* `SamplingLog` - Does a coin flip. You provide a number between 0 and 1 representing probability. Providing\n.1 for example means there's about a 10% rate of logging.\n\n\n```\n    private static final Logger LOG = SamplngLog.of(MyClass.class, .1); // 10% logged\n```\n\n\notj-logging\n-----------\n\nThe main module ties together all of the above modules.  In addition, it provides adapters to pull\ntogether other common logging frameworks:\n\n* `java.util.logging` via `jul-to-slf4j`\n* `commons-logging` via `jcl-over-slf4j`\n* `log4j` via `log4j-over-slf4j`\n\nUsually you will not need to use this artifact directly, it is used by `otj-server`.\n\n----\nCopyright (C) 2016 OpenTable, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentable%2Fotj-logging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentable%2Fotj-logging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentable%2Fotj-logging/lists"}