{"id":20876798,"url":"https://github.com/vitalijr2/mock-loggers","last_synced_at":"2026-05-09T20:49:38.379Z","repository":{"id":262286212,"uuid":"886338995","full_name":"vitalijr2/mock-loggers","owner":"vitalijr2","description":"Logging services can be tested using mock loggers backed by Mockito: there are implementations for commons-logging, elf4j, JDK logging, SLF4J and tinylog.","archived":false,"fork":false,"pushed_at":"2025-03-02T18:16:39.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T05:36:21.526Z","etag":null,"topics":["commons-logging","elf4j","elf4j-provider","jdk-logging","junit-extension","logger-mock","mock-library","mocking","mocks","slf4j","slf4j-api","slf4j-binding","slf4j-logger","slf4j-loggers","slf4j-provider","test-logger","tinylog","tinylog-provider","tinylog-writer"],"latest_commit_sha":null,"homepage":"","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/vitalijr2.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-10T19:05:13.000Z","updated_at":"2025-02-23T21:37:01.000Z","dependencies_parsed_at":"2024-12-21T20:22:40.324Z","dependency_job_id":"2caee6b6-5725-462e-80d8-a8653b554b25","html_url":"https://github.com/vitalijr2/mock-loggers","commit_stats":null,"previous_names":["vitalijr2/mock-loggers"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitalijr2%2Fmock-loggers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitalijr2%2Fmock-loggers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitalijr2%2Fmock-loggers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitalijr2%2Fmock-loggers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitalijr2","download_url":"https://codeload.github.com/vitalijr2/mock-loggers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243250681,"owners_count":20261065,"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":["commons-logging","elf4j","elf4j-provider","jdk-logging","junit-extension","logger-mock","mock-library","mocking","mocks","slf4j","slf4j-api","slf4j-binding","slf4j-logger","slf4j-loggers","slf4j-provider","test-logger","tinylog","tinylog-provider","tinylog-writer"],"created_at":"2024-11-18T06:54:59.076Z","updated_at":"2026-05-09T20:49:38.373Z","avatar_url":"https://github.com/vitalijr2.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mock Loggers\n\nDifferent logging services can be tested using mock loggers backed by [Mockito][].\n\nIn addition to the [GitLab page][gl-project], this project can also be found on [GitHub][gh-project].\n\n\u003e [!NOTE]\n\u003e The minimum required Java version has been updated to 17.  \n\u003e Version **1.3.0** remains compatible with Java 11.\n\n[![Java Version][java-version]][jdk-download]\n![jUnit Version][junit-version]\n![Mockito Version][mockito-version]\n[![License][license-badge]][license-link]  \n[![GitLab master pipeline][gitlab-master-pipeline]][gitlab-master-pipeline-link]\n[![Codacy Badge][codacy-badge]][codacy-badge-link]\n[![Codacy Coverage][codacy-coverage]][codacy-coverage-link]\n![GitLab last commit][gitlab-last-commit]\n[![Today's hits][today-hits]][today-hits-link]\n\n## Table of Contents\n\n\u003c!--ts--\u003e\n* [How to use](#how-to-use)\n* [Other logging libraries and frameworks](#other-logging-libraries-and-frameworks)\n* [Credits](#credits)\n* [Contributing](#contributing)\n* [History](#history)\n* [License](#license)\n\n\u003c!-- Created by https://github.com/ekalinin/github-markdown-toc --\u003e\n\u003c!-- Added by: r2, at: Fri Feb 21 08:07:42 PM EET 2025 --\u003e\n\n\u003c!--te--\u003e\n\n## How to use\n\n\u003e [!IMPORTANT]\n\u003e This library does not support _parallel test execution_.\n\nThe simplest usage example looks like this:\n\n```java\n@Test\nvoid helloWorld() {\n    var helloService = new HelloService();\n\n    assertDoesNotThrow(helloService::sayHelloWorld);\n\n    verify(System.getLogger(\"HelloService\")).log(Level.INFO, \"Hello World!\");\n}\n```\n\nNow this library implements services for [JDK Platform Logging][jdk-logging],\n[Apache Commons Logging][commons-logging], [elf4j][], [SLF4J][slf4j] and [tinylog][].\n\nSee more examples in the relevant modules of this project:\n\n* for Apache Commons Logging in [mock-loggers-commons-logging](commons-logging)\n* for elf4j in [mock-loggers-elf4j](elf4j)\n* for JDK Platform Logging in [mock-loggers-jdk-platform-logging](jdk-platform-logging)\n* for SLF4J in [mock-loggers-slf4j](slf4j)\n* for tinylog in [mock-loggers-tinylog-writer](tinylog-writer) and [mock-loggers-tinylog-provider](tinylog-provider)\n\n## Other logging libraries and frameworks\n\n* [Apache Log4j: Unit Testing in Maven][log4j-unit-testing-in-maven]\n* [Unit Test logback Using JUnit][logback-unit-test-using-junit], it's old but gold\n\n## Credits\n\nThere are two projects which inspired me to make this library:\n\n* [s4u/slf4j-mock][slf4j-mock]\n* [ocarlsen/mock-slf4j-impl][mock-slf4j-impl]\n\n## Contributing\n\nPlease read [Contributing](contributing.md).\n\n## History\n\nSee [Changelog](changelog.md)\n\n## License\n\n```text\nCopyright (C) 2024 Vitalij Berdinskih\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\nSee full text [here](LICENSE \"the LICENSE file\").\n\n[Mockito]: https://site.mockito.org\n\n[gl-project]: https://gitlab.com/vitalijr2/mock-loggers\n\n[gh-project]: https://github.com/vitalijr2/mock-loggers\n\n[jdk-logging]: https://www.baeldung.com/java-9-logging-api \"Java Platform Logging API\"\n\n[commons-logging]: https://commons.apache.org/proper/commons-logging/ \"Apache Commons Logging\"\n\n[elf4j]: https://github.com/elf4j \"Easy Logging Facade for Java\"\n\n[slf4j]: https://www.slf4j.org/ \"Simple Logging Facade for Java\"\n\n[tinylog]: https://tinylog.org/v2/ \"The lightweight logging framework\"\n\n[java-version]: https://img.shields.io/static/v1?label=Java\u0026message=17\u0026color=blue\u0026logoColor=E23D28\n\n[jdk-download]: https://www.oracle.com/java/technologies/downloads/#java17\n\n[junit-version]: https://img.shields.io/static/v1?label=jUnit\u0026message=6.0.0\u0026color=blue\u0026logo=junit5\u0026logoColor=E23D28\n\n[mockito-version]: https://img.shields.io/static/v1?label=Mockito\u0026message=5.20.0\u0026color=blue\u0026logoColor=E23D28\n\n[gitlab-master-pipeline]: https://gitlab.com/vitalijr2/mock-loggers/badges/master/pipeline.svg\n\n[gitlab-master-pipeline-link]: https://gitlab.com/vitalijr2/mock-loggers/-/commits/master\n\n[codacy-badge]: https://app.codacy.com/project/badge/Grade/924ce8a8d86644ec86c1749afa81f3c2\n\n[codacy-badge-link]: https://app.codacy.com/gl/vitalijr2/mock-loggers/dashboard?utm_source=gl\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade\n\n[codacy-coverage]: https://app.codacy.com/project/badge/Coverage/924ce8a8d86644ec86c1749afa81f3c2\n\n[codacy-coverage-link]: https://app.codacy.com/gl/vitalijr2/mock-loggers/dashboard?utm_source=gl\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_coverage\n\n[gitlab-last-commit]: https://img.shields.io/gitlab/last-commit/vitalijr2/mock-loggers\n\n[today-hits]: https://hits.sh/github.com/vitalijr2/mock-loggers.svg?view=today-total\u0026label=today's%20hits\n\n[today-hits-link]: https://hits.sh/github.com/vitalijr2/mock-loggers/\n\n[log4j-unit-testing-in-maven]: https://logging.apache.org/log4j/2.3.x/manual/configuration.html#UnitTestingInMaven\n\n[logback-unit-test-using-junit]: https://www.iamninad.com/posts/unit-test-logback-using-junit/\n\n[slf4j-mock]: https://github.com/s4u/slf4j-mock\n\n[mock-slf4j-impl]: https://github.com/ocarlsen/mock-slf4j-impl\n\n[license-badge]: https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat\n\n[license-link]: https://www.apache.org/licenses/LICENSE-2.0.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitalijr2%2Fmock-loggers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitalijr2%2Fmock-loggers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitalijr2%2Fmock-loggers/lists"}