{"id":14977522,"url":"https://github.com/akkinoc/logback-access-spring-boot-starter","last_synced_at":"2025-05-14T13:05:12.449Z","repository":{"id":36979612,"uuid":"47953830","full_name":"akkinoc/logback-access-spring-boot-starter","owner":"akkinoc","description":"Spring Boot Starter for Logback-access.","archived":false,"fork":false,"pushed_at":"2025-05-01T06:49:42.000Z","size":1509,"stargazers_count":196,"open_issues_count":14,"forks_count":36,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-01T07:34:52.134Z","etag":null,"topics":["java","java-library","kotlin","kotlin-library","logback","logback-access","logger","logging","spring-boot","spring-boot-starter","spring-framework"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/akkinoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"akkinoc"}},"created_at":"2015-12-14T05:26:04.000Z","updated_at":"2025-05-01T06:49:44.000Z","dependencies_parsed_at":"2024-01-27T03:23:56.828Z","dependency_job_id":"93227353-52ca-48d8-a520-8007fa595de5","html_url":"https://github.com/akkinoc/logback-access-spring-boot-starter","commit_stats":{"total_commits":749,"total_committers":15,"mean_commits":49.93333333333333,"dds":0.506008010680908,"last_synced_commit":"c2a99a49814bdba057e5a7025ef8680dee6f8b99"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkinoc%2Flogback-access-spring-boot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkinoc%2Flogback-access-spring-boot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkinoc%2Flogback-access-spring-boot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkinoc%2Flogback-access-spring-boot-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akkinoc","download_url":"https://codeload.github.com/akkinoc/logback-access-spring-boot-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149879,"owners_count":22022851,"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":["java","java-library","kotlin","kotlin-library","logback","logback-access","logger","logging","spring-boot","spring-boot-starter","spring-framework"],"created_at":"2024-09-24T13:55:49.122Z","updated_at":"2025-05-14T13:05:12.399Z","avatar_url":"https://github.com/akkinoc.png","language":"Kotlin","funding_links":["https://github.com/sponsors/akkinoc"],"categories":[],"sub_categories":[],"readme":"# logback-access-spring-boot-starter\n\n[![maven central badge]][maven central]\n[![javadoc badge]][javadoc]\n[![release badge]][release]\n[![build badge]][build]\n[![codecov badge]][codecov]\n[![license badge]][license]\n[![sponsor badge]][sponsor]\n\n[maven central]: https://maven-badges.herokuapp.com/maven-central/dev.akkinoc.spring.boot/logback-access-spring-boot-starter\n[maven central badge]: https://maven-badges.herokuapp.com/maven-central/dev.akkinoc.spring.boot/logback-access-spring-boot-starter/badge.svg\n[javadoc]: https://javadoc.io/doc/dev.akkinoc.spring.boot/logback-access-spring-boot-starter\n[javadoc badge]: https://javadoc.io/badge2/dev.akkinoc.spring.boot/logback-access-spring-boot-starter/javadoc.svg\n[release]: https://github.com/akkinoc/logback-access-spring-boot-starter/releases\n[release badge]: https://img.shields.io/github/v/release/akkinoc/logback-access-spring-boot-starter?color=brightgreen\u0026sort=semver\n[build]: https://github.com/akkinoc/logback-access-spring-boot-starter/actions/workflows/build.yml\n[build badge]: https://github.com/akkinoc/logback-access-spring-boot-starter/actions/workflows/build.yml/badge.svg\n[codecov]: https://codecov.io/gh/akkinoc/logback-access-spring-boot-starter\n[codecov badge]: https://codecov.io/gh/akkinoc/logback-access-spring-boot-starter/branch/main/graph/badge.svg\n[license]: LICENSE.txt\n[license badge]: https://img.shields.io/github/license/akkinoc/logback-access-spring-boot-starter?color=blue\n[sponsor]: https://github.com/sponsors/akkinoc\n[sponsor badge]: https://img.shields.io/static/v1?logo=github\u0026label=sponsor\u0026message=%E2%9D%A4\u0026color=db61a2\n\n[Spring Boot] Starter for [Logback-access].\n\n[Spring Boot]: https://spring.io/projects/spring-boot\n[Logback-access]: https://logback.qos.ch/access.html\n\n## Features\n\n* Auto-detects your configuration file and auto-configures Logback-access.\n* Supports configuration files on the classpath.\n* Provides extensions (`\u003cspringProfile\u003e` tag, `\u003cspringProperty\u003e` tag) for configuration files.\n* Supports rewriting of some attributes by HTTP forward headers (\"X-Forwarded-*\").\n* Supports remote user provided by Spring Security.\n* Provides configuration properties to enable the tee filter.\n\nSupports the following web servers:\n\n|          | Web MVC (Servlet Stack) | WebFlux (Reactive Stack) |\n|:--------:|:-----------------------:|:------------------------:|\n|  Tomcat  |            ✅           |            ✅            |\n|  Jetty   |            ✅           |            ✅            |\n| Undertow |            ✅           |            ✅            |\n|  Netty   |            -            |  🚧 (under development)  |\n\n## Dependencies\n\nDepends on:\n\n* Java 17 or 21\n* Kotlin 1.9\n* Spring Boot 3.4\n* Logback-access 2.0\n\n## Usage\n\n### Adding the Dependency\n\nThe artifact is published on [Maven Central Repository][maven central].\nIf you are using Maven, add the following dependency.\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003edev.akkinoc.spring.boot\u003c/groupId\u003e\n    \u003cartifactId\u003elogback-access-spring-boot-starter\u003c/artifactId\u003e\n    \u003cversion\u003e${logback-access-spring-boot-starter.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nIf you are using the Tomcat web server, also add the following dependency.\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ech.qos.logback.access\u003c/groupId\u003e\n    \u003cartifactId\u003elogback-access-tomcat\u003c/artifactId\u003e\n    \u003cversion\u003e${logback-access.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nIf you are using the Jetty web server, also add the following dependency.\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ech.qos.logback.access\u003c/groupId\u003e\n    \u003cartifactId\u003elogback-access-jetty12\u003c/artifactId\u003e\n    \u003cversion\u003e${logback-access.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Configuring the Logback-access\n\nCreate a Logback-access configuration file \"logback-access.xml\" in the root of the classpath.\n\nFor example:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cconfiguration\u003e\n    \u003cappender name=\"console\" class=\"ch.qos.logback.core.ConsoleAppender\"\u003e\n        \u003cencoder\u003e\n            \u003cpattern\u003ecommon\u003c/pattern\u003e\n        \u003c/encoder\u003e\n    \u003c/appender\u003e\n    \u003cappender-ref ref=\"console\"/\u003e\n\u003c/configuration\u003e\n```\n\nSee also the Logback-access official documents:\n\n* [Logback-access configuration](https://logback.qos.ch/access.html)\n\n### Access Logging\n\nWhen access the web application, it is logged.\n\nFor example:\n\n```console\n0:0:0:0:0:0:0:1 - - [24/Oct/2021:15:32:03 +0900] \"GET / HTTP/1.1\" 200 319\n0:0:0:0:0:0:0:1 - - [24/Oct/2021:15:32:03 +0900] \"GET /favicon.ico HTTP/1.1\" 404 111\n0:0:0:0:0:0:0:1 - - [24/Oct/2021:15:32:04 +0900] \"GET / HTTP/1.1\" 304 0\n```\n\n## Auto-detection of Configuration File\n\n### Priority Order\n\nWhen the web application is started, the configuration files are searched in the following order.\nThe first configuration file found will be used.\n\n1. \"logback-access-test.xml\" in the root of the classpath.\n2. \"logback-access.xml\" in the root of the classpath.\n3. \"logback-access-test-spring.xml\" in the root of the classpath.\n4. \"logback-access-spring.xml\" in the root of the classpath.\n5. [fallback configuration file (appends to the console with a common pattern)](src/main/resources/dev/akkinoc/spring/boot/logback/access/logback-access-spring.xml).\n\n### Separation for Testing\n\nIf you are using Maven and place the \"logback-access-test(-spring).xml\" file under the \"src/test/resources\" folder,\nMaven will ensure that it won't be included in the artifact produced.\nThus, you can use a different configuration file \"logback-access-test(-spring).xml\" during testing,\nand another file \"logback-access(-spring).xml\" in production.\nThis is the same concept as the [Logback configuration (\"logback.xml\" and \"logback-test.xml\")].\n\n[Logback configuration (\"logback.xml\" and \"logback-test.xml\")]: https://logback.qos.ch/manual/configuration.html#auto_configuration\n\n## Extensions for Configuration File\n\n### Profile-specific Configuration\n\nThe `\u003cspringProfile\u003e` tag lets you optionally include or exclude sections of configuration based on the active Spring profiles.\nThe usage of this extension is the same as the [Spring Boot Logback Extension \"Profile-specific Configuration\"].\n\n[Spring Boot Logback Extension \"Profile-specific Configuration\"]: https://docs.spring.io/spring-boot/docs/3.0.6/reference/html/features.html#features.logging.logback-extensions.profile-specific\n\n\u003e ```xml\n\u003e \u003cspringProfile name=\"staging\"\u003e\n\u003e     \u003c!-- configuration to be enabled when the \"staging\" profile is active --\u003e\n\u003e \u003c/springProfile\u003e\n\u003e \u003cspringProfile name=\"dev | staging\"\u003e\n\u003e     \u003c!-- configuration to be enabled when the \"dev\" or \"staging\" profiles are active --\u003e\n\u003e \u003c/springProfile\u003e\n\u003e \u003cspringProfile name=\"!production\"\u003e\n\u003e     \u003c!-- configuration to be enabled when the \"production\" profile is not active --\u003e\n\u003e \u003c/springProfile\u003e\n\u003e ```\n\n### Environment Properties\n\nThe `\u003cspringProperty\u003e` tag lets you expose properties from the Spring Environment for use within Logback.\nThe usage of this extension is the same as the [Spring Boot Logback Extension \"Environment Properties\"].\n\n[Spring Boot Logback Extension \"Environment Properties\"]: https://docs.spring.io/spring-boot/docs/3.0.6/reference/html/features.html#features.logging.logback-extensions.environment-properties\n\n\u003e ```xml\n\u003e \u003cspringProperty scope=\"context\" name=\"fluentHost\" source=\"myapp.fluentd.host\" defaultValue=\"localhost\"/\u003e\n\u003e \u003cappender name=\"FLUENT\" class=\"ch.qos.logback.more.appenders.DataFluentAppender\"\u003e\n\u003e     \u003cremoteHost\u003e${fluentHost}\u003c/remoteHost\u003e\n\u003e     ...\n\u003e \u003c/appender\u003e\n\u003e ```\n\n## Configuration Properties\n\nProvides the following configuration properties.\nThese can be configured by your \"application.yml\", \"application.properties\", etc.\n\n```yaml\n# The configuration properties for Logback-access.\nlogback.access:\n  # Whether to enable auto-configuration.\n  # Defaults to true.\n  enabled: true\n  # The location of the configuration file.\n  # Specify a URL that starts with \"classpath:\" or \"file:\".\n  # Auto-detected by default:\n  #   1. \"classpath:logback-access-test.xml\"\n  #   2. \"classpath:logback-access.xml\"\n  #   3. \"classpath:logback-access-test-spring.xml\"\n  #   4. \"classpath:logback-access-spring.xml\"\n  #   5. \"classpath:dev/akkinoc/spring/boot/logback/access/logback-access-spring.xml\"\n  config: classpath:your-logback-access.xml\n  # The strategy to change the behavior of IAccessEvent.getLocalPort.\n  # Defaults to \"server\".\n  #   \"local\":\n  #     Returns the port number of the interface on which the request was received.\n  #     Equivalent to ServletRequest.getLocalPort when using a servlet web server.\n  #   \"server\":\n  #     Returns the port number to which the request was sent.\n  #     Equivalent to ServletRequest.getServerPort when using a servlet web server.\n  #     Helps to identify the destination port number used by the client when forward headers are enabled.\n  local-port-strategy: server\n  # The properties for the Tomcat web server.\n  tomcat:\n    # Whether to enable the request attributes to work with RemoteIpValve.\n    # Defaults to the presence of RemoteIpValve enabled by the property \"server.forward-headers-strategy=native\".\n    request-attributes-enabled: true\n  # The properties for the Undertow web server.\n  undertow:\n    # Whether to enable UndertowOptions.RECORD_REQUEST_START_TIME.\n    # Used to measure IAccessEvent.getElapsedTime and IAccessEvent.getElapsedSeconds.\n    # Defaults to true.\n    record-request-start-time: true\n  # The properties for the tee filter.\n  tee-filter:\n    # Whether to enable the tee filter.\n    # Defaults to false.\n    enabled: true\n    # The host names to activate.\n    # By default, all hosts are activated.\n    includes: your-development-host\n    # The host names to deactivate.\n    # By default, all hosts are activated.\n    excludes: your-production-host\n```\n\n## API Reference\n\nPlease refer to the [Javadoc][javadoc].\n\n## Release Notes\n\nPlease refer to the [Releases][release] page.\n\n## License\n\nLicensed under the [Apache License, Version 2.0][license].\n\n## Support the Project\n\nIf this project is useful to you, I appreciate giving a ⭐ star to this repository.\nI would also appreciate if you would consider 💖 [sponsoring][sponsor] as well.\nYour support is my biggest motive force. Thanks ✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakkinoc%2Flogback-access-spring-boot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakkinoc%2Flogback-access-spring-boot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakkinoc%2Flogback-access-spring-boot-starter/lists"}