{"id":19041110,"url":"https://github.com/everythingme/android-logger","last_synced_at":"2026-03-16T00:10:04.393Z","repository":{"id":12229573,"uuid":"14839566","full_name":"EverythingMe/android-logger","owner":"EverythingMe","description":null,"archived":false,"fork":false,"pushed_at":"2014-02-26T23:12:01.000Z","size":1068,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-06-24T22:42:29.468Z","etag":null,"topics":[],"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/EverythingMe.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":"2013-12-01T13:54:22.000Z","updated_at":"2016-06-09T01:15:44.000Z","dependencies_parsed_at":"2022-09-09T09:01:53.919Z","dependency_job_id":null,"html_url":"https://github.com/EverythingMe/android-logger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EverythingMe/android-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fandroid-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fandroid-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fandroid-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fandroid-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EverythingMe","download_url":"https://codeload.github.com/EverythingMe/android-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fandroid-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30556558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-15T23:30:23.986Z","status":"ssl_error","status_checked_at":"2026-03-15T23:28:43.564Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2024-11-08T22:27:20.686Z","updated_at":"2026-03-16T00:10:04.359Z","avatar_url":"https://github.com/EverythingMe.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"android-logger\n==============\n\nDescription and features will be explained later.\n\n## Features\nIn process of development.\n\n## Setup Project\n\nTBE (To be explained)\n\n## Usage\n\n### Start Logger\nTo start logging add next lines in your `Application` class in `onCreate()` method. In fact, you can start the logger in any other place in your app, just take into consideration, that the logger will log only after starting it. Do it only once.\n\n``` java\npublic class YourApplication extends Application {\n\n\t@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tLog.start(this);\n\t\t...\n\t}\n}\n```\n\n### Log \n\nThe idea is not to make any difference between `android.util.Log` usage and this logger usage. But it still have few very minor differences to make it even more simpler for coding:\n\n**Log levels**:\n* TRACE\n* DEBUG\n* INFO\n* WARNING\n* ERROR\n\n**Example:**\n\n``` java\n// simple text\nLog.e(this, \"Your error text message\");\n\n// text with parameters\nLog.e(this, \"Your {} text {} number {}\", param1, param2, param3);\n\t\n// simple text with exception\nLog.e(this, \"Your error text message\", throwable);\n```\n\n\n## Configuration\n\nLogger has many options of configuration. In addition, you can add your own implementations and adjust the logger for your needs. Let's go over all configuration options and what will you get for each of them.\n\n### 1. Format the output\nSet the output format of the logs. If you need your own structure, because you want to analyze or do any other action on the final logs, you would probably prefer them in specific structure.\n\nImplement `LogEntryFormatter` and set in `LogConfiguration`.\u003cbr\u003e\nOut of the box formatters:\n* `SimpleLogEntryFormatter`\n* `JsonLogEntryFormatter`\n\n**Example:**\n``` java\n// create logger configuration\nLogConfiguration logConfiguration = new LogConfiguration.Builder(this)\n\t.setLogEntryFormatter(new JsonLogEntryFormatter())\n\t...\n\t.build();\n\n// set configuration and start\t\nLog.setConfiguration(logConfiguration);\nLog.start(this);\n```\n\n### 2. System events\nTo have a better picture of what's going on in your application when something goes wrong, you would be glad to have information about battery, screen, wifi, network and many other device changes. This logger gives this option and will listen to a system intents. \n\nImplement `SystemReceiver` and set in `LogConfiguration`.\u003cbr\u003e\nOut of the box receivers:\n* `BatteryReceiver`\n* `ScreenReceiver`\n \n**Example:**\n\n``` java\n// create logger configuration\nLogConfiguration logConfiguration = new LogConfiguration.Builder(this)\n\t.addSystemReceiver(new BatteryReceiver())\n\t.addSystemReceiver(new ScreenReceiver())\n\t...\n\t.build();\n\t\n// set configuration and start\t\nLog.setConfiguration(logConfiguration);\nLog.start(this);\n```\n\nTo stop events from being logged once you leave the app. Add this line into main `Activity` in `onDestroy()` method, or any other place where you decide to stop the logger.\n\n``` java\nLog.stop();\n```\n\n### 3. Reporting\nReport and send your logs if crash happened or just by demand. This logger library allows you to implement the dispatcher that will take the `Report` and send/share it to your server or any other place.\n\nImplement `ReportDispatcher`\u003cbr\u003e\nOut of the box dispatchers:\n* `EmailReportDispatcher`\n* `DriveReportDispatcher`\n \n#### Crash report\n\nOnce the crash happened, you would like to report it. Prepare the `Report` you want to send and set it in `LogConfiguration`.\n \n**Prepare `Report` example:**\n\n``` java\n// create filter for crash report\nLogsFilter logsFilter = new LogsFilter();\nlogsFilter.setLogLevel(Level.TRACE);\nlogsFilter.setLogTypes(Types.APP | Types.RECEIVER);\nlogsFilter.setFromTime(Calendar.getInstance().getTimeInMillis() - 1000 * 60 * 60);\n\n// create crash report definition\nReport crashReport = new Report.Builder()\n    .setIncludeDeviceInfo(true)\n    .setMergeLogs(true)\n    .setLogsFilter(logsFilter)\n    .build(this);\n```\n\n**Set crash configuration:**\n\n``` java\n// create logger configuration\nLogConfiguration logConfiguration = new LogConfiguration.Builder(this)\n    .addCrashDispatcher(new EmailReportDispatcher(\"roman@everything.me\"))\n    .setCrashReport(crashReport)\n    ...\n    .build();\n\n// set configuration and start\t\nLog.setConfiguration(logConfiguration);\nLog.start(this);\n```\n\n### 4. More\n\n- Set **thread priority** - The thread priority of the logger\n- Set cache **memory buffer** log size - The size of number of logs in-memory\n- Set **cache target** type:\n\t- Memory only - logs will be persisted in-memory only\n\t- Internal - logs will be flushed into internal disk\n\t- External - logs will be flushed into external disk if such exists\n- Set **history** max days - The max number of history days of logs on disk\t\n\n**Example:**\n\n``` java\n// create logger configuration\nLogConfiguration logConfiguration = new LogConfiguration.Builder(this)\n    .setLogPriority(Thread.MIN_PRIORITY)\n    .setMemoryBufferSize(100)\n    .setCacheTargetType(CacheTargetType.EXTERNAL)\n    .setMaxHistoryDays(7)\n    ...\n    .build();\n```\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/EverythingMe/android-logger/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverythingme%2Fandroid-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feverythingme%2Fandroid-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverythingme%2Fandroid-logger/lists"}