{"id":15010286,"url":"https://github.com/bryanmikaelian/clj-polylith-slf4j-logback-example","last_synced_at":"2026-04-04T00:03:49.705Z","repository":{"id":252075892,"uuid":"839354669","full_name":"bryanmikaelian/clj-polylith-slf4j-logback-example","owner":"bryanmikaelian","description":"A small demo with Clojure and Polylith showing how to configure SLF4J + Logback","archived":false,"fork":false,"pushed_at":"2024-08-07T13:25:20.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T13:25:30.581Z","etag":null,"topics":["clojure","logback","pedestal","polylith","sl4fj","slf4j-api"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bryanmikaelian.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-07T12:48:44.000Z","updated_at":"2024-08-13T21:58:57.000Z","dependencies_parsed_at":"2024-08-07T15:32:18.575Z","dependency_job_id":"dfa5fa8e-72ed-4470-94ef-6ac5179c93e8","html_url":"https://github.com/bryanmikaelian/clj-polylith-slf4j-logback-example","commit_stats":null,"previous_names":["bryanmikaelian/clj-polylith-slf4j-logback-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanmikaelian%2Fclj-polylith-slf4j-logback-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanmikaelian%2Fclj-polylith-slf4j-logback-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanmikaelian%2Fclj-polylith-slf4j-logback-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanmikaelian%2Fclj-polylith-slf4j-logback-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bryanmikaelian","download_url":"https://codeload.github.com/bryanmikaelian/clj-polylith-slf4j-logback-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243290713,"owners_count":20267772,"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","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":["clojure","logback","pedestal","polylith","sl4fj","slf4j-api"],"created_at":"2024-09-24T19:33:23.363Z","updated_at":"2025-12-29T00:28:25.673Z","avatar_url":"https://github.com/bryanmikaelian.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clj-polylith-slf4j-logback-example\nA small demo with Clojure and Polylith showing how to configure SLF4J + Logback\n\n\n## Background\n\nThis polylith workspace has one base: `server`. This base has logging configured with the following libraries:\n\n- `io.pedestal/pedestal.log`\n- `org.slf4j/slf4j-api`\n- `ch.qos.logback/logback-classic`\n\nIt also configures a `development` project and `server` project that generates a `jar` artifact.\n\nIn the development project, logback will use `resources/logback-test.xml` but in the jar file, we will use `bases/server/resources/logback.xml`\n\nThe most important take away from all this:\n\n**logback.xml must at the top of the resources folder. It cannot be nested under something like `bases/server/resources/server/logback.xml`**\n\n\n## Requirements\n\n- Clojure 1.11\n- Java 21 (although it probably works with other LTS versions)\n- A working REPL (this project used nrepl + conjure)\n\n\n## Demo\n\n### JAR File\n\nUsing `clojure.tools.build`, we can generate a `jar` file like so\n\n\n```\nclj -T:build uberjar :project server\n```\n\nYou should see the following output:\n\n```\nCompiling com.example.server.core...\nBuilding uberjar target/server.jar...\nUberjar is built.\n```\n\nRun the jar like so and note how the `l/debug` statement is not printed based [on our configuration](https://github.com/bryanmikaelian/clj-polylith-slf4j-logback-example/blob/main/bases/server/resources/logback.xml#L9)\n\n```\njava -jar projects/server/target/server.jar\n````\n\n```\nINFO  com.example.server.core - {:msg \"hello. I show up in production.\", :line 10}\nERROR com.example.server.core - {:msg \"hello. I show up in production.\", :line 11}\nWARN  com.example.server.core - {:msg \"hello. I show up in production.\", :line 12}\n```\n\n\n### REPL\nStart a repl\n\n```\nclj -A:dev\n```\n\nYou should see the following log output immediately. Note the `DEBUG` statement because our [development configuration allows for debug logs](https://github.com/bryanmikaelian/clj-polylith-slf4j-logback-example/blob/main/development/resources/logback-test.xml)\n\n```\nINFO  com.example.server.core - {:msg \"hello. I show up in production.\", :line 10}\nERROR com.example.server.core - {:msg \"hello. I show up in production.\", :line 11}\nWARN  com.example.server.core - {:msg \"hello. I show up in production.\", :line 12}\nDEBUG com.example.server.core - {:msg \"hello. I show up in development.\", :line 13}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanmikaelian%2Fclj-polylith-slf4j-logback-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbryanmikaelian%2Fclj-polylith-slf4j-logback-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanmikaelian%2Fclj-polylith-slf4j-logback-example/lists"}