{"id":19191619,"url":"https://github.com/mihnita/java-color-loggers","last_synced_at":"2025-09-16T09:57:24.854Z","repository":{"id":4687706,"uuid":"5834471","full_name":"mihnita/java-color-loggers","owner":"mihnita","description":"Color console logging for log4j and jdk","archived":false,"fork":false,"pushed_at":"2025-05-22T07:02:58.000Z","size":132,"stargazers_count":38,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-22T08:23:52.672Z","etag":null,"topics":["color","colorization","java","logging"],"latest_commit_sha":null,"homepage":"http://www.mihai-nita.net/java/","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/mihnita.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","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,"zenodo":null}},"created_at":"2012-09-17T00:02:56.000Z","updated_at":"2025-05-22T07:03:02.000Z","dependencies_parsed_at":"2025-04-20T08:51:47.098Z","dependency_job_id":null,"html_url":"https://github.com/mihnita/java-color-loggers","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mihnita/java-color-loggers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihnita%2Fjava-color-loggers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihnita%2Fjava-color-loggers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihnita%2Fjava-color-loggers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihnita%2Fjava-color-loggers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mihnita","download_url":"https://codeload.github.com/mihnita/java-color-loggers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihnita%2Fjava-color-loggers/sbom","scorecard":{"id":644645,"data":{"date":"2025-08-11","repo":{"name":"github.com/mihnita/java-color-loggers","commit":"0f9de6c5613a913516c1b06e4a632b66fd684de9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/mihnita/java-color-loggers/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/mihnita/java-color-loggers/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/mihnita/java-color-loggers/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/mihnita/java-color-loggers/codeql-analysis.yml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: License.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: License.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.0.5 not signed: https://api.github.com/repos/mihnita/java-color-loggers/releases/4890812","Warn: release artifact v1.0.4.1 not signed: https://api.github.com/repos/mihnita/java-color-loggers/releases/25460","Warn: release artifact v1.0.4 not signed: https://api.github.com/repos/mihnita/java-color-loggers/releases/24916","Warn: release artifact v1.0.5 does not have provenance: https://api.github.com/repos/mihnita/java-color-loggers/releases/4890812","Warn: release artifact v1.0.4.1 does not have provenance: https://api.github.com/repos/mihnita/java-color-loggers/releases/25460","Warn: release artifact v1.0.4 does not have provenance: https://api.github.com/repos/mihnita/java-color-loggers/releases/24916"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-2qrg-x229-3v8q","Warn: Project is vulnerable to: GHSA-65fg-84f6-3jq3","Warn: Project is vulnerable to: GHSA-f7vh-qwp3-x37m","Warn: Project is vulnerable to: GHSA-fp5r-v3w9-4333","Warn: Project is vulnerable to: GHSA-w9p3-5cr8-m3jj"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T11:48:39.410Z","repository_id":4687706,"created_at":"2025-08-21T11:48:39.410Z","updated_at":"2025-08-21T11:48:39.410Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275399569,"owners_count":25457779,"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","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["color","colorization","java","logging"],"created_at":"2024-11-09T11:43:40.918Z","updated_at":"2025-09-16T09:57:24.827Z","avatar_url":"https://github.com/mihnita.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"java-color-loggers\n==================\n\nColor console logging for log4j and jdk\n\n## Usage\n\n* Download the latest color-loggers jar from [releases](https://github.com/mihnita/java-color-loggers/releases) or build them yourself\n* Download [jansi-1.18.jar](https://fusesource.github.io/jansi/download.html) - optional, see below\u003cbr /\u003e\n(`jansi-1.18` is the latest one at this time, but I use nothing fancy, so I don't expect surprises with other versions)\n* Make sure the jar(s) mentioned above are somewhere in the `classpath` (whatever method you are using for your project)\n\nOn Mac OS X, Linux, UNIX, most (all?) the consoles support ANSI escapes.\n\nANSI escapes work out of the box in Windows 10.\n\nOn older Windows versions you can use the [ConEmu console](https://conemu.github.io/),\nor the standard Windows console with [ansicon](https://github.com/adoxa/ansicon/downloads/)\nand the `AnsiColorConsole*` flavors of the loggers.\nBut if you want the standard Windows console without `ansicon`,\nthen you should use `JAnsiColorConsole*` and you also need `jansi`.\n\nThere are pros and cons for each option, I hope to write an article when I have some time.\n\n---\n\n### JDK (or JUL, `java.util.logging`)\n\nIn the java logging configuration file (default in `$JAVA_HOME/lib/logging.properties`)\nuse `com.mihnita.colorlog.jdk.AnsiColorConsoleHandler`\nor `com.mihnita.colorlog.jdk.JAnsiColorConsoleHandler` as handler.\n\nThey work the same as `java.util.logging.ConsoleHandler`.\n\nSee an example in `src/test/resources/logJdk.properties`\n\n---\n\n### Log4j\n\nIn `log4j.properties` (or whatever config file you use for log4j)\nuse `com.mihnita.colorlog.log4j.AnsiColorConsoleAppender`\nor `com.mihnita.colorlog.log4j.JAnsiColorConsoleAppender` as appender.\n\nThey work the same as `org.apache.log4j.ConsoleAppender`.\n\nSee an example in `src/test/resources/log4j.properties` or `src/test/resources/log4j.xml`\n\n---\n\n### Logback\n\nLogback already allows for colored output using jansi, but does not allow configuring the colors.\nBut now, with `java-color-loggers`, you can.\n\nIn `logback.xml` (or whatever config file you use for Logback) find the appender that\nuses `ch.qos.logback.core.ConsoleAppender`, find the `encoder` element, and add a `class`\nattribute with the value of `com.mihnita.colorlog.logback.ColorPatternLayoutEncoder`.\n\nAnd as children of the `encoder` element you can add the following elements to configure the colors:\n```\n \u003cerrorColor\u003e1;31\u003c/errorColor\u003e\n \u003cwarningColor\u003e1;33\u003c/warningColor\u003e\n \u003cinfoColor\u003e32\u003c/infoColor\u003e\n \u003cdebugColor\u003e36\u003c/debugColor\u003e\n \u003ctraceColor\u003e1;30\u003c/traceColor\u003e\n ```\n\nThe values should be valid ANSI escape sequences, without the `{esc}[` and without the final `m`.\n\nSee an example in `src/test/resources/logback.xml`\n\n---\n\n### Log4j 2\n\nLog4j 2 supports colors out of the box, see\nhttps://logging.apache.org/log4j/2.x/manual/layouts.html#enable-jansi\n\n---\n\n### SLF4J\n\nNothing special about it, you configure the logger “underneath it”\n(`jdk` or `log4j` or `logback`).\n\n---\n\n## Status\n\n**Build:** [![Build Status](https://travis-ci.org/mihnita/java-color-loggers.png)](https://travis-ci.org/mihnita/java-color-loggers)\n\n**DepShield:** ![DepShield Status](https://depshield.sonatype.org/badges/mihnita/java-color-loggers/depshield.svg)\n\n---\n\n## Building\n\n```\nmvn clean install\n```\n\nBut `maven` (or maybe `junit`?) “hijacks” the output of the test.\nSo not all the lines that would normally be colored are colored in the `maven` test.\nThe best way to try things is to run the tests in `ColorLogTest.java` as a normal\napplication against the final jar (with the 3rd party jars in “the right place”).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihnita%2Fjava-color-loggers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmihnita%2Fjava-color-loggers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihnita%2Fjava-color-loggers/lists"}