{"id":21699555,"url":"https://github.com/klemek/simplelogger","last_synced_at":"2025-10-07T05:31:40.577Z","repository":{"id":57720784,"uuid":"146738582","full_name":"Klemek/SimpleLogger","owner":"Klemek","description":"A simple but useful Java logger to use everywhere.","archived":false,"fork":false,"pushed_at":"2020-10-13T09:12:35.000Z","size":56,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-25T20:10:01.825Z","etag":null,"topics":["java","java-8","java8","logger","maven"],"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/Klemek.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}},"created_at":"2018-08-30T11:15:45.000Z","updated_at":"2021-03-31T20:05:47.000Z","dependencies_parsed_at":"2022-09-26T21:41:14.230Z","dependency_job_id":null,"html_url":"https://github.com/Klemek/SimpleLogger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Klemek%2FSimpleLogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Klemek%2FSimpleLogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Klemek%2FSimpleLogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Klemek%2FSimpleLogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Klemek","download_url":"https://codeload.github.com/Klemek/SimpleLogger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235593358,"owners_count":19015139,"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-8","java8","logger","maven"],"created_at":"2024-11-25T20:10:05.278Z","updated_at":"2025-10-07T05:31:35.299Z","avatar_url":"https://github.com/Klemek.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Logger\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.klemek/simple-logger.svg)](https://search.maven.org/search?q=g:%22com.github.klemek%22%20AND%20a:%22simplelogger%22)\n[![Build Status](https://img.shields.io/travis/Klemek/SimpleLogger.svg?style=popout)](https://travis-ci.org/Klemek/SimpleLogger)\n[![Scc Count Badge](https://sloc.xyz/github/klemek/simplelogger/?category=code)](https://github.com/boyter/scc/#badges-beta)\n[![Coverage Status](https://img.shields.io/coveralls/github/Klemek/SimpleLogger.svg)](https://coveralls.io/github/Klemek/SimpleLogger?branch=master)\n![License](https://img.shields.io/github/license/Klemek/SimpleLogger.svg)\n[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/Klemek/SimpleLogger.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/Klemek/SimpleLogger/context:java)\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/Klemek/SimpleLogger.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/Klemek/SimpleLogger/alerts/)\n\nA simple but useful Java logger to use everywhere.\n\nCurrent version v1.3.1\n\n## Download\n\n[simplelogger-1.3.1.jar](../../releases/download/simplelogger-1.3.1/simplelogger-1.3.1.jar)\n\n## How to use\n\nInitialization :\n```Java\nLogger.init(\"logging.properties\", Level.WARNING);\n// or\nLogger.init(\"logging.properties\");\nLogger.setLevel(Level.WARNING);\n```\n\nConfiguration file as follow (example) :\n```\n# Parameters for good behavior\nhandlers=java.util.logging.ConsoleHandler\n.level=WARNING\njava.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter\n\n# Customize date/time shown with this line\njava.util.logging.SimpleFormatter.format=[%1$tF %1$tT][%4$s]%5$s %n\n\n# Specify your app name here\napp_name=YourApp\n# (Optional, specify your app package)\ndefault_package=com.your.app\n# (Optional, specify an output file pattern)\noutput_file=output.log\n```\n\nThe default package works as follow : When logging stack trace of an error, it will stop when the package doesnt't match your app anymore. It helps having small and relevant stack trace in logs.\n\nUsage :\n```Java\n//general logging\nLogger.log(\"my message\"); //INFO log\nLogger.log(\"my message : {0}\", 123); //INFO log with parameters\nLogger.log(Level.WARNING, \"my message\"); //custom level log\nLogger.log(Level.SEVERE, \"my message : {0}-{1}\", 123, 456); //custom level log with parameters\n//exception logging\nLogger.log(exception1); //SEVERE logging with stack trace\nLogger.log(exception2, \"exception when doing task\"); //SEVERE logging with stack trace and message\nLogger.log(Level.WARNING, exception3); //custom level logging without stack trace\nLogger.log(Level.INFO, exception4, \"exception when doing task\"); //custom level logging with message\n```\nThis will show the following :\n```\n[INFO][MyApp-CallingClass] my message\n[INFO][MyApp-CallingClass] my message : 123\n[WARNING][MyApp-CallingClass] my message\n[SEVERE][MyApp-CallingClass] my message : 123-456\n[SEVERE][MyApp-CallingClass] (exception1.toString)\n[SEVERE][MyApp-CallingClass]    (exception1.stackTrace)\n[SEVERE][MyApp-CallingClass]    (exception1.stackTrace)\n[SEVERE][MyApp-CallingClass]    ...\n[SEVERE][MyApp-CallingClass] exception when doing task : (exception2.toString)\n[SEVERE][MyApp-CallingClass]    (exception2.stackTrace)\n[SEVERE][MyApp-CallingClass]    (exception2.stackTrace)\n[SEVERE][MyApp-CallingClass]    ...\n[WARNING][MyApp-CallingClass] (exception3.toString)\n[INFO][MyApp-CallingClass] exception when doing task : (exception4.toString)\n```\n\n## Maven\n\nYou can use this project as a maven dependency with this :\n```XML\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.klemek\u003c/groupId\u003e\n    \u003cartifactId\u003esimple-logger\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklemek%2Fsimplelogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklemek%2Fsimplelogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklemek%2Fsimplelogger/lists"}