{"id":43646784,"url":"https://github.com/studio42gmbh/log42","last_synced_at":"2026-02-04T19:00:27.128Z","repository":{"id":41657718,"uuid":"442464138","full_name":"studio42gmbh/log42","owner":"studio42gmbh","description":"Simple, secure and fast logging for Java","archived":false,"fork":false,"pushed_at":"2025-12-14T03:47:38.000Z","size":621,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-16T03:20:15.638Z","etag":null,"topics":["ansi","java","logging","profiling"],"latest_commit_sha":null,"homepage":"https://studio42gmbh.github.io/log42/","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/studio42gmbh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-28T12:58:16.000Z","updated_at":"2025-12-14T03:47:42.000Z","dependencies_parsed_at":"2023-11-30T00:22:57.094Z","dependency_job_id":"68315002-1651-42c3-a7a9-2ec79a089f6f","html_url":"https://github.com/studio42gmbh/log42","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/studio42gmbh/log42","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studio42gmbh%2Flog42","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studio42gmbh%2Flog42/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studio42gmbh%2Flog42/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studio42gmbh%2Flog42/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/studio42gmbh","download_url":"https://codeload.github.com/studio42gmbh/log42/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studio42gmbh%2Flog42/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29092981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ansi","java","logging","profiling"],"created_at":"2026-02-04T19:00:20.245Z","updated_at":"2026-02-04T19:00:27.120Z","avatar_url":"https://github.com/studio42gmbh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub](https://img.shields.io/github/license/studio42gmbh/log42)\n![GitHub top language](https://img.shields.io/github/languages/top/studio42gmbh/log42)\n![GitHub last commit](https://img.shields.io/github/last-commit/studio42gmbh/log42)\n![GitHub issues](https://img.shields.io/github/issues/studio42gmbh/log42)\n\n# Log 42\n\nLog 42 is a simple, secure and fast logging for Java. Everyone who does not need JNDI lookups in his logging might enjoy that ;)\n\nIf you like Log 42 or have constructive critique dont hesitate to write us directly on info@s42m.de. We are always happy for qualified feedback!\n\nHave a great day!\n\nBenjamin Schiller\n\n\u003e \"Look up to the stars not down on your feet. Be curious!\" _Stephen Hawking 1942 - 2018_\n\n\n## Features\n\n* Log to console (out and err)\n* Log to file (log and error log)\n* Simple logging of times with start and stop extension\n* Log times into google chrome performance json format (https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)\n* Asynchronous file logging optional\n* Support ANSI coloring\n* Easily extend and change the logging\n\n\n## Future Plans\n\n* Logging to rsyslog (https://de.wikipedia.org/wiki/Rsyslog)\n* Extend demo cases with tutorials like showing extension\n* Make log42 available in public maven repos\n\n\n## Usage\n\n\nInclude the [Maven Package](https://github.com/studio42gmbh/log42/packages/1983722) in your pom.xml\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ede.s42\u003c/groupId\u003e\n  \u003cartifactId\u003elog42\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.2\u003c/version\u003e\n\u003c/dependency\u003e \n```\n\nHow to get maven packages from github: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry\n\n* Get package for maven (or Download project)\n* Add as maven dependency to your project locally (see above)\n* Use LogManager and Logger\n* Configure settings by adding a log42.properties into the root folder of your project resources\n\nFind the Javadoc here: https://studio42gmbh.github.io/log42/javadoc/\n\nImportant: If you use it as local project you also need to get a local copy of the [Base 42 library](https://github.com/studio42gmbh/base42) from github.\n\n\n### Just use in your class\n\nThe usage is mostly compatible to the logging provided by log4j et al.\n\n```java\nimport de.s42.log.LogManager;\nimport de.s42.log.Logger;\nimport de.s42.log42.Version;\n\npublic class UseLogging\n{\n\n\t// create a class based logger - as the name is arbitrary you can also share loggers across systems if preferred\n\tprivate final static Logger log = LogManager.getLogger(UseLogging.class.getName());\n\n\tpublic static void main(String... args)\n\t{\n\t\t// simple info logging - the messages will be joined with a \" \" in between\n\t\tlog.info(\"Welcome\", \"to\", \"Logging\");\n\n\t\t// simple debug logging - available is: trace, debug, info, warn, error, fatal\n\t\tlog.debug(\"Version of Log42\", Version.getVersion());\n\n\t\t// starts a timer with id MyTimer in the default implementation the timers are threadbound\n\t\tlog.start(\"MyTimer\");\n\n\t\t// stops the timer with id MyTimer and prints the duration as DEBUG log\n\t\tlog.stopDebug(\"MyTimer\");\n\n\t\t// simple info logging\n\t\tlog.info(\"Bye\");\n\t}\n}\n```\nFor complete code see: https://github.com/studio42gmbh/log42/blob/main/src/test/java/de/s42/log42/examples/UseLogging.java\n\nThis leads to the following console output (in Netbeans et al. the below at ... is nicely leading to the spot where the logging was put in code):\n\n```\n00:27:54:862 INFO [main] de.s42.log42.examples.UseLogging Welcome to Logging\n at de.s42.log42.examples.UseLogging.main(UseLogging.java:45)\n00:27:54:885 DEBUG [main] de.s42.log42.examples.UseLogging Version of Log42 0.1.0 #cd642099a34 2021-12-29T23:26:49Z\n at de.s42.log42.examples.UseLogging.main(UseLogging.java:48)\n00:27:54:886 DEBUG [main] de.s42.log42.examples.UseLogging Stopped timer MyTimer 0.04 ms.\n at de.s42.log42.examples.UseLogging.main(UseLogging.java:54)\n00:27:54:897 INFO [main] de.s42.log42.examples.UseLogging Bye\n at de.s42.log42.examples.UseLogging.main(UseLogging.java:57)\n ```\n\nand the following file output:\n\n```\n2021-12-30 00:27:54:862;INFO;[main];de.s42.log42.examples.UseLogging;Welcome to Logging;\\n at de.s42.log42.examples.UseLogging.main(UseLogging.java:45);\n2021-12-30 00:27:54:885;DEBUG;[main];de.s42.log42.examples.UseLogging;Version of Log42 0.1.0 #cd642099a34 2021-12-29T23:26:49Z;\\n at de.s42.log42.examples.UseLogging.main(UseLogging.java:48);\n2021-12-30 00:27:54:886;DEBUG;[main];de.s42.log42.examples.UseLogging;Stopped timer MyTimer 0.04 ms.;\\n at de.s42.log42.examples.UseLogging.main(UseLogging.java:54);\n2021-12-30 00:27:54:897;INFO;[main];de.s42.log42.examples.UseLogging;Bye;\\n at de.s42.log42.examples.UseLogging.main(UseLogging.java:57);\n```\n\nWe just added a flavor of start and stopping timers and we removed all the fancy conversions of contents when logging them.\n\nBut you can easily extend that in your own logger by overloading the method:\n\n```java\nprotected String getMessagesInfo(Throwable ex, Object... messages)\n```\nwhen overloading from de.s42.log42.impl.ConsoleLogger or de.s42.log42.impl.FileAndConsoleLogger\n\n\n### log42.properties\n\nHere is an example of the log42.properties you can put into your resources root.\n```properties\nloggerFactory = de.s42.log42.impl.FileAndConsoleLogger\nenableAnsi = true\nlevel = DEBUG\nerrorLevel = ERROR\nprintTraceLine = true\ndateFormat = HH:mm:ss:SSS\nlogToFile = true\nwriteFileAsynchronous = false\nfileWriterDaemon = false\nremoveAnsiInFiles = true\nremoveInnerNewlinesInFiles = true\nfileInfoSeparator = ;\nfileDateFormat = yyyy-MM-dd HH:mm:ss:SSS\nfile = ./target/log/%y/%m/log42-test-%y-%m-%d.log\nfileErrorLevel = ERROR\nerrorFile = ./target/log/%y/%m/log42-test-%y-%m-%d.error.log\nlogToPerformanceFile = true\nperformanceFile = ./target/log/%y/%m/log42-test-%y-%m-%d.performance.json\n```\n\nFor code see: https://github.com/studio42gmbh/log42/blob/main/src/test/resources/log42.properties\n\n\n### Explanation of properties of de.s42.log42.impl.FileAndConsoleLogger\n\n\n#### enableAnsi\nElements will use ANSI for coloring \n\n(Default is: false)\n\n\n#### level\nLowest level which will be logged to console\n\n(Default is: DEBUG)\n\n\n#### errorLevel\nLowest level which will be logged into err output\n\n(Default is: ERROR)\n\n\n#### printTraceLine\nAdds a line under each log which allows to get to the code where the log was done in IDEs like netbeans\n\n(Default is: false)\n\n\n#### dateFormat\nFormat of the date info \n\nFor format details see https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/text/SimpleDateFormat.html\n\n(Default is: HH:mm:ss:SSS)\n\n\n#### logToFile\nIs file logging active \n\n(Default is: false)\n\n\n#### writeFileAsynchronous\nWrite file in own thread \n\nIf activated make sure you consider the implications when exiting while writing or keeping the process open by writer\n\n(Default is: false)\n\n\n#### fileWriterDaemon\nFile writer will be spawned as daemon thread or not \n\nIf not you have to call FileAndConsoleLogger.finishFileWriting() or exit hard otherwise the process will no terminate\n\n(Default is: false) \n\n\n#### removeAnsiInFiles\nElements will remove user ANSI for coloring from files \n\n(Default is: false)\n\n\n#### removeInnerNewlinesInFiles\nElements will replace newlines within the logs with \"\\n\" \n\n(Default is: false)\n\n\n#### fileInfoSeparator\nString used for separating the info parts in a file \n\n(Default is: ' ')\n\n\n#### fileDateFormat\nFormat of the date info \n\nFor format details see https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/text/SimpleDateFormat.html\n\n(Default is: yyyy-MM-dd HH:mm:ss:SSS)\n\n\n#### file\nFile to log into \n\nSupported replacements: \n\n%y = year like 2021; \n\n%m = month like 06; \n\n%d = day like 27; \n\n(Required if logToFile == true)\n\n```\n./target/log/%y/%m/log42-test-%y-%m-%d.log\n```\n\n\n#### fileErrorLevel\nLowest level which will be logged into errorFile output \n\n(Default is: NEVER)\n\n\n#### errorFile\nFile to log errors into \n\nSupported replacements: \n\n%y = year like 2021; \n\n%m = month like 06; \n\n%d = day like 27; \n\n(Required if fileErrorLevel \u003e NEVER)\n\n```\n./target/log/%y/%m/log42-test-%y-%m-%d.error.log\n```\n\n\n#### logToPerformanceFile\nFile to log performance data into \n\n(Default is: false) \n\n\n#### performanceFile\nFile to log performance infos (start, stop) into\n\nSupported replacements: \n\n%y = year like 2021; \n\n%m = month like 06; \n\n%d = day like 27; \n\nFor the resulting JSON file format see https://www.chromium.org/developers/how-tos/trace-event-profiling-tool\n\n(Required if logToPerformanceFile == true)\n\n```\n./target/log/%y/%m/log42-test-%y-%m-%d.performance.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudio42gmbh%2Flog42","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudio42gmbh%2Flog42","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudio42gmbh%2Flog42/lists"}