{"id":26096302,"url":"https://github.com/echocat/tomcat-json-logging","last_synced_at":"2025-04-12T11:45:18.716Z","repository":{"id":91158474,"uuid":"156436660","full_name":"echocat/tomcat-json-logging","owner":"echocat","description":"Extension to Tomcat logging that will format the contents as JSON to be better compatible with logging environments for microservices","archived":false,"fork":false,"pushed_at":"2025-03-17T08:55:38.000Z","size":163,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-26T06:34:28.294Z","etag":null,"topics":["json","logging","microservice","tomcat","tomcat-log"],"latest_commit_sha":null,"homepage":null,"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/echocat.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":"2018-11-06T19:30:40.000Z","updated_at":"2025-03-17T08:55:41.000Z","dependencies_parsed_at":"2023-11-29T09:29:19.328Z","dependency_job_id":"a7fcb819-46e5-4c70-9a1d-13059876556e","html_url":"https://github.com/echocat/tomcat-json-logging","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echocat%2Ftomcat-json-logging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echocat%2Ftomcat-json-logging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echocat%2Ftomcat-json-logging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echocat%2Ftomcat-json-logging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/echocat","download_url":"https://codeload.github.com/echocat/tomcat-json-logging/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248564384,"owners_count":21125407,"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":["json","logging","microservice","tomcat","tomcat-log"],"created_at":"2025-03-09T14:44:57.257Z","updated_at":"2025-04-12T11:45:18.692Z","avatar_url":"https://github.com/echocat.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tomcat-json-logging\n\nExtension to Tomcat logging that will format the contents as JSON to be better compatible with logging environments for microservices.\n\n## TOC\n\n1. [Example](#example)\n2. [Installation](#installation)\n3. [Customization](#customization)\n4. [FAQ](#faq)\n5. [Contributing](#contributing)\n6. [License](#license)\n\n## Example\n\nIf everything is configured correctly you will see output like this on our console:\n```json\n..\n{\"when\":\"2018-11-07T14:40:58.540+0100\",\"level\":\"INFO\",\"source\":\"org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:488)\",\"logger\":\"org.apache.coyote.http11.Http11AprProtocol\",\"thread\":\"main\",\"processId\":22640,\"message\":\"Starting ProtocolHandler [\\\"http-apr-8080\\\"]\"}\n{\"when\":\"2018-11-07T14:40:58.555+0100\",\"level\":\"INFO\",\"source\":\"org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:488)\",\"logger\":\"org.apache.coyote.ajp.AjpAprProtocol\",\"thread\":\"main\",\"processId\":22640,\"message\":\"Starting ProtocolHandler [\\\"ajp-apr-8009\\\"]\"}\n{\"when\":\"2018-11-07T14:40:58.560+0100\",\"level\":\"INFO\",\"source\":\"org.apache.catalina.startup.Catalina.start(Catalina.java:654)\",\"logger\":\"org.apache.catalina.startup.Catalina\",\"thread\":\"main\",\"processId\":22640,\"message\":\"Server startup in 859 ms\"}\n..\n```\n\n## Installation\n\n### 1. Download\n\nGo to [Release page](https://github.com/echocat/tomcat-json-logging/releases/latest) and download the matching version of `tomcat-juli.jar` for your Tomcat version. If you have Tomcat `8.5.32` running download `tomcat-juli-8.5.32.jar` and so on...\n\nReplace `bin/tomcat-juli.jar` inside your Tomcat distribution directory with this file.\n\n\u003e No worries! This files is a combined version of the original Tomcat version and the new functionality.\n\n### 2. Configure\n\nJust replace the content of `conf/logging.properties` in your Tomcat distribution directory with the following content:\n```properties\nhandlers = org.echocat.tjl.Handler\n```\n\nThis will log everything directly to the console in JSON format (by default).\n\n## Customization\n\n### Using system properties or environment variables\n\nYou can either specify a system property or environment variable to change the behavior of the logging of the Tomcat. This values always override every settings in `conf/logging.properties`.\n\n##### Available properties\n\n| System property | Environment property | Description |\n|---|---|---|\n| `log.format` | `LOG_FORMAT` | Forces a different formatter. See [Available formats](#available-formats). |\n| `log.level` | `LOG_LEVEL` | Forces a different global log level. Pleas refer [`java.util.logging.Level`](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html) for different levels. For example `FINE` for more output while local development. |\n\n##### Available formats\n\n| Value | Description |\n|---|---|\n| `json` | Will use `org.echocat.tjl.JsonFormatter` - see [Available formatter](#available-formatter) for more information. |\n| `text` | Will use `org.echocat.tjl.TextFormatter` - see [Available formatter](#available-formatter) for more information. |\n\n### Using `conf/logging.properties`\n\n##### Available properties\n\n| Name | Description | Default |\n|------|-------------|---------|\n| `org.echocat.tjl.Handler.level` | Minimum level of log entries to be logged/visible. Pleas refer [`java.util.logging.Level`](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html) for more information.  | `ALL` |\n| `org.echocat.tjl.Handler.formatter` | Formatter to format the message in the console. | `org.echocat.tjl.JsonFormatter` |\n\n##### Available formatter\n\n| Name | Description |\n|------|-------------|\n| `org.echocat.tjl.JsonFormatter` | Formats the whole output as JSON. One entry per line. |\n| `org.echocat.tjl.TextFormatter` | Formats every entry per line in a simple way - better for local debugging. |\n\n## FAQ\n\n#### How to activate debug output temporary?\n\n```bash\nLOG_LEVEL=debug bin/catalina.sh run\n```\n\n#### How to make output temporarily better readable?\n\n```bash\nLOG_FORMAT=text bin/catalina.sh run\n```\n\n## Contributing\n\ntomcat-json-logging is an open source project by [echocat](https://echocat.org).\nSo if you want to make this project even better, you can contribute to this project on [Github](https://github.com/echocat/tomcat-json-logging)\nby [fork us](https://github.com/echocat/tomcat-json-logging/fork).\n\nIf you commit code to this project, you have to accept that this code will be released under the [license](#license) of this project.\n\n## License\n\nSee the [LICENSE](LICENSE) file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechocat%2Ftomcat-json-logging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fechocat%2Ftomcat-json-logging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechocat%2Ftomcat-json-logging/lists"}