{"id":37443559,"url":"https://github.com/jisungbin/ktor-client-logging-json","last_synced_at":"2026-01-16T06:46:53.150Z","repository":{"id":201206802,"uuid":"705542059","full_name":"jisungbin/ktor-client-logging-json","owner":"jisungbin","description":"If content-type is json or hal+json, it will automatically output the beautified json.","archived":false,"fork":false,"pushed_at":"2024-06-21T07:54:39.000Z","size":195,"stargazers_count":3,"open_issues_count":11,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-06-22T14:41:44.194Z","etag":null,"topics":["ktor-client","logging"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/jisungbin.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":"2023-10-16T08:08:48.000Z","updated_at":"2024-03-11T09:18:56.000Z","dependencies_parsed_at":"2023-12-24T08:26:51.524Z","dependency_job_id":"30deacd9-9483-486d-8ee0-b48a5924c5e8","html_url":"https://github.com/jisungbin/ktor-client-logging-json","commit_stats":null,"previous_names":["jisungbin/ktor-client-logging-json"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jisungbin/ktor-client-logging-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jisungbin%2Fktor-client-logging-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jisungbin%2Fktor-client-logging-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jisungbin%2Fktor-client-logging-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jisungbin%2Fktor-client-logging-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jisungbin","download_url":"https://codeload.github.com/jisungbin/ktor-client-logging-json/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jisungbin%2Fktor-client-logging-json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: 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":["ktor-client","logging"],"created_at":"2026-01-16T06:46:52.449Z","updated_at":"2026-01-16T06:46:53.142Z","avatar_url":"https://github.com/jisungbin.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ktor-client-logging-json\n\nIf content-type is `json` or `hal+json`, it will automatically output the beautified json.\n\n| Before | After |\n| :---: | :---: |\n| ![image](https://github.com/jisungbin/ktor-client-logging-json/assets/40740128/2db5de96-5fd8-4c28-9da9-aad0545af335) | ![image](https://github.com/jisungbin/ktor-client-logging-json/assets/40740128/5205b000-5edd-4197-bd43-35bba1414094) |\n\n### Usage\n\nThis plugin is implemented in the same way as the official [`ktor-client-logging`](https://ktor.io/docs/client-logging.html). \nHowever, there are three differences:\n\n1. all interfaces/properties are prefixed with `JsonAware`.\n2. the `Logger` interface has a `fun prettifyJson(json: String): String = json` function is added.\n3. the default log level is raised to `LogLevel.Body`.\n\nAdded to the `Logger` interface, the `prettifyJson(json: String): String` function is called when \nthe content to be logged is of type `json` or `hal+json`, and the result is logged.\n\nThe Json deserialization library to use for the `prettifyJson()` implementation comes with\nthe Moshi, Jackson, and Gson implementations by default.\n\nBy default, the Json deserialization rules are as follows:\n\n- Indent 2 spaces\n- Allow `null`\n- Allow lenient json\n\nThe specific implementations are available as `JsonAwareLogger.useMoshi()`, `JsonAwareLogger.useJackson()`, and `JsonAwareLogger.useGson()`.\n\n### Download\n\n- `ktor-client-logging-json`: ![ktor-client-logging-json](https://img.shields.io/maven-central/v/land.sungbin.ktor.client.logging/ktor-client-logging-json?style=flat-square)\n- `ktor-client-logger-moshi`: ![ktor-client-logger-moshi](https://img.shields.io/maven-central/v/land.sungbin.ktor.client.logger/ktor-client-logger-moshi?style=flat-square)\n- `ktor-client-logger-jackson`: ![ktor-client-logger-jackson](https://img.shields.io/maven-central/v/land.sungbin.ktor.client.logger/ktor-client-logger-jackson?style=flat-square)\n- `ktor-client-logger-gson`: ![ktor-client-logger-gson](https://img.shields.io/maven-central/v/land.sungbin.ktor.client.logger/ktor-client-logger-gson?style=flat-square)\n\n```kotlin\ndependencies {\n  implementation(\"land.sungbin.ktor.client.logging:ktor-client-logging-json:${version}\")\n  \n  implementation(\"land.sungbin.ktor.client.logger:ktor-client-logger-moshi:${version}\")\n  implementation(\"land.sungbin.ktor.client.logger:ktor-client-logger-jackson:${version}\")\n  implementation(\"land.sungbin.ktor.client.logger:ktor-client-logger-gson:${version}\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjisungbin%2Fktor-client-logging-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjisungbin%2Fktor-client-logging-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjisungbin%2Fktor-client-logging-json/lists"}