{"id":20726961,"url":"https://github.com/hmcts/java-logging","last_synced_at":"2025-04-23T18:50:11.670Z","repository":{"id":22385644,"uuid":"94910222","full_name":"hmcts/java-logging","owner":"hmcts","description":"Library for common logging approach for java application","archived":false,"fork":false,"pushed_at":"2025-04-17T15:34:17.000Z","size":1660,"stargazers_count":4,"open_issues_count":2,"forks_count":4,"subscribers_count":189,"default_branch":"master","last_synced_at":"2025-04-18T01:57:25.399Z","etag":null,"topics":["application-insights","logback","logstash","sprint-boot-plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"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/hmcts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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":"2017-06-20T16:03:16.000Z","updated_at":"2025-04-07T09:12:35.000Z","dependencies_parsed_at":"2023-09-23T04:05:37.990Z","dependency_job_id":"ee355fec-a8bf-4932-a8c6-e67b73e5d6eb","html_url":"https://github.com/hmcts/java-logging","commit_stats":null,"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fjava-logging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fjava-logging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fjava-logging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fjava-logging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmcts","download_url":"https://codeload.github.com/hmcts/java-logging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250496214,"owners_count":21440227,"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":["application-insights","logback","logstash","sprint-boot-plugin"],"created_at":"2024-11-17T04:28:35.200Z","updated_at":"2025-04-23T18:50:11.653Z","avatar_url":"https://github.com/hmcts.png","language":"Java","readme":"[![GitHub version](https://badge.fury.io/gh/hmcts%2Fjava-logging.svg)](https://badge.fury.io/gh/hmcts%2Fjava-logging)\n[![JitPack Badge](https://github.com/hmcts/java-logging/actions/workflows/jitpack_build.yml/badge.svg)](https://github.com/hmcts/java-logging/actions/workflows/jitpack_build.yml)\n[![Known Vulnerabilities](https://snyk.io/test/github/hmcts/java-logging/badge.svg)](https://snyk.io/test/github/hmcts/java-logging)\n\n# Java logging\n\nA Java module which standardises the logging for the reform projects.\n\n## Prerequisites\n\n- [Java 17](https://adoptium.net/)\n\n## User guide\n\nThe module provides a `logback.xml` configuration file which configures Logback to use a default reform format.\nIt allows a number of configuration options to customize the logging to your needs.\n\n\n### Basic usage\n\nSimply add base component as your project's dependency and then one or more of three components discussed below to use it.\n\nBase component dependency, gradle:\n```groovy\nimplementation group: 'com.github.hmcts.java-logging', name: 'logging', version: '6.1.2'\n```\n\n#### java-logging-insights\n\nUse for automatic configuration of Azure Application Insights for a Spring Boot project. [Read more](java-logging-appinsights/README.md)\n\n### Configuration defaults\n\nBy default the module will use a simple, human-friendly logging format which can be used out-of-the-box for development:\n\n```\n2017-02-02 12:22:23,647 INFO [main] io.dropwizard.assets.AssetsBundle: Registering AssetBundle with name: swagger-assets for path /swagger-static/*\n2017-02-02 12:22:23,806 INFO [main] org.reflections.Reflections: Reflections took 96 ms to scan 1 urls, producing 79 keys and 87 values\n2017-02-02 12:22:24,835 INFO [main] io.dropwizard.server.DefaultServerFactory: Registering jersey handler with root path prefix: /\n```\n\nRoot logging level will be set to `INFO`. It can be adjusted by setting a `ROOT_LOGGING_LEVEL` environment variable.\n\n### Additional Logback configuration:\n\nAdditional Logback configuration can be provided by adding a `logback-includes.xml` file to the classpath root\n(just drop it in the `main/resources` folder).\nThis allows to define any configuration allowed by Logback XML config, where a typical usage could be defining more\nspecific loggers, e.g.:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cincluded\u003e\n  \u003clogger name=\"uk.goc.hmcts.reform\" level=\"DEBUG\"/\u003e\n  \u003clogger name=\"uk.goc.hmcts.reform.resources\" level=\"WARN\"/\u003e\n\u003c/included\u003e\n```\n\nPath to this file can adjusted by setting a `LOGBACK_INCLUDES_FILE` environment variable.\n\nLogback can print additional information while processing its configuration files. This can be enabled by setting\n`LOGBACK_CONFIGURATION_DEBUG` variable to `true`.\n\nLog pattern related configurations:\n\n| variable                    | default                     |\n| --------------------------- | --------------------------- |\n| LOGBACK_DATE_FORMAT         | yyyy-MM-dd'T'HH:mm:ss.SSSZZ |\n| EXCEPTION_LENGTH            | 50                          |\n| LOGGER_LENGTH               | 50                          |\n| CONSOLE_LOG_PATTERN         | %d{${LOGBACK_DATE_FORMAT}} %-5level [%thread] %logger{${LOGGER_LENGTH}}%ex{${EXCEPTION_LENGTH}} %msg%n}                        |\n\nwhere\n - LOGBACK_DATE_FORMAT: Date format is default logstash encoder date format. `REQUIRE` fields are flags representing show/hide feature.\n - EXCEPTION_LENGTH: how many lines to show in an exception stack trace ( per exception not including causes)\n - LOGGER_LENGTH: how long the logger name can be before logback starts abbreviating the package names\n\n## Development guide\n\n[Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) will automatically download a\nproject-local [Gradle](https://gradle.org/) distribution the first time you run any of the `gradlew` commands below.\n\n### Tests and verification\n\nTo run all unit tests:\n\n```bash\n./gradlew test\n```\n\nTo execute [Checkstyle](http://checkstyle.sourceforge.net/) and [PMD](http://pmd.sourceforge.net/) checks:\n\n```bash\n./gradlew check\n```\n\nYou can also execute both via:\n\n```bash\n./gradlew build\n```\n\n### Installing\n\nTo install the artifact to a local Maven repository:\n```bash\n./gradlew install\n```\n\n### Releasing\n\nBefore releasing a new version create a PR and run the following script to update the README to use the new version number.\n\n```bash\n./prepare-for-release.sh\n```\n\nTo publish a new release create a new release via the GitHub UI. The tag selected will be used as the version number.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmcts%2Fjava-logging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmcts%2Fjava-logging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmcts%2Fjava-logging/lists"}