{"id":17061582,"url":"https://github.com/paxa/compact_okhttp_logger","last_synced_at":"2026-05-16T22:01:48.937Z","repository":{"id":250303506,"uuid":"834073817","full_name":"Paxa/compact_okhttp_logger","owner":"Paxa","description":"Http logger that print 1 line for request and 1 line for response","archived":false,"fork":false,"pushed_at":"2024-07-26T11:14:05.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T12:07:20.989Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/Paxa.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-07-26T11:07:51.000Z","updated_at":"2024-07-26T11:14:08.000Z","dependencies_parsed_at":"2024-07-26T12:45:43.580Z","dependency_job_id":"633ce2a0-75a8-4fe8-a002-fd48dde8f820","html_url":"https://github.com/Paxa/compact_okhttp_logger","commit_stats":null,"previous_names":["paxa/compact_okhttp_logger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Paxa/compact_okhttp_logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paxa%2Fcompact_okhttp_logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paxa%2Fcompact_okhttp_logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paxa%2Fcompact_okhttp_logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paxa%2Fcompact_okhttp_logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Paxa","download_url":"https://codeload.github.com/Paxa/compact_okhttp_logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paxa%2Fcompact_okhttp_logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270997454,"owners_count":24682047,"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-18T02:00:08.743Z","response_time":89,"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":"2024-10-14T10:47:33.181Z","updated_at":"2026-05-16T22:01:43.911Z","avatar_url":"https://github.com/Paxa.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About `SmallHttpLogger` library\n\n\nHTTP logger that print 1 line for request and 1 line for response, for better readability.\n\n\n### Usage\n\nin gradle:\n```groovy\nimplementation group: 'com.paxa', name: 'compact_okhttp_logger', version: '0.1.0'\n```\n\nin code:\n```java\n// import com.paxa.util.CompactOkhttpLogger;\n\nCompactOkhttpLogger httpLogger = new CompactOkhttpLogger(logger, true, true);\nOkHttpClient httoClient = new OkHttpClient.Builder()\n  .addInterceptor(httpLogger).build();\n```\n\n### Output example:\n\n```\n\nHTTP REQ: POST http://example.com/user/v1/profile\n---\nSystem-Timestamp: 2023-05-18T10:49:45\n---\n{\"meta_data\":{\"event_id\":\"916b9200-d927-4630-a560-d782286c0e34\",\"job_id\":\"user-186987387-903905-INTERNAL\"}}\"}\n\n\nHTTP RESP: POST http://example.com/user/v1/profile -\u003e 400 (275 ms)\n---\n{\"success\":false,\"result\":\"INQUIRY_FAILED\",\"inquiry_rc\":\"SYSTEM_BS_ERROR_SOMETHING\"}\n\n```\n\n### Other Features\n\n```java\n// LOG LEVEL\nhttpLogger.logAsDebug(); // will call logger.debug()\nhttpLogger.logAsInfo(); // will call logger.info()\n\n\n// LOG ONLY FAILURES\n\n// will print req and resp only when response has exception or failed\n// default filter  is (hasError || !response.isSuccessful())\n\nhttpLogger.logOnlyFailures();\n\n// with custom filter\nhttpLogger.logOnlyFailures((response, hasError) -\u003e {\n    return hasError || (response.code() \u003e 400 \u0026\u0026 response.code() != 404));\n});\n\n// SKIP HEADERS\n\nhttpLogger.skipCommonHeaders()\nhttpLogger.skipHeaders(\"x-envoy-upstream-service-time\", \"x-correlation-id\") // case insensitive\nhttpLogger.redactHeaders(\"authentication\", \"pin\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaxa%2Fcompact_okhttp_logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaxa%2Fcompact_okhttp_logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaxa%2Fcompact_okhttp_logger/lists"}