{"id":19875055,"url":"https://github.com/smartmovesystems/androidfilelogger","last_synced_at":"2026-01-24T00:18:39.494Z","repository":{"id":181446419,"uuid":"228529711","full_name":"SmartMoveSystems/androidfilelogger","owner":"SmartMoveSystems","description":"SmartMove Android File Logger","archived":false,"fork":false,"pushed_at":"2024-08-29T01:26:06.000Z","size":231,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T01:11:14.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/SmartMoveSystems.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":"2019-12-17T04:03:30.000Z","updated_at":"2024-08-29T01:26:10.000Z","dependencies_parsed_at":"2024-05-29T03:02:22.465Z","dependency_job_id":null,"html_url":"https://github.com/SmartMoveSystems/androidfilelogger","commit_stats":null,"previous_names":["smartmovesystems/androidfilelogger"],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartMoveSystems%2Fandroidfilelogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartMoveSystems%2Fandroidfilelogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartMoveSystems%2Fandroidfilelogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartMoveSystems%2Fandroidfilelogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmartMoveSystems","download_url":"https://codeload.github.com/SmartMoveSystems/androidfilelogger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252023319,"owners_count":21682164,"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":[],"created_at":"2024-11-12T16:26:39.341Z","updated_at":"2026-01-24T00:18:34.447Z","avatar_url":"https://github.com/SmartMoveSystems.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# androidfilelogger\nSmartMove Android File Logger. Redirects Timber logging to a rolling set of log files. Allows \nautomatic logging of crashes to a configured HTTP endpoint.\n\n## Including in your project\n\nIn your project-level build.gradle:\n\n```\nallprojects {\n    repositories {\n        ...\n        maven {\n            name 'jitpack'\n            url \"https://jitpack.io\"\n        }\n        ...\n    }\n}\n```\n\nIn your application-level build.gradle:\n\n```\nimplementation 'com.github.SmartMoveSystems:androidfilelogger:5.2'\n```\n\n## Setting up to log to file and report crashes\n\nIn you application's onCreate() method:\n\n```\n@Override\npublic void onCreate()\n{\n    super.onCreate()\n    ...\n    // This will start writing Timber logs to file\n    val tree = FileLogTree(filesDir, BuildConfig.DEBUG)\n    Timber.plant(tree)\n    logManager = tree\n    apiConfig =  ApiConfig(\n        getString(R.string.crash_log_upload_url), // Must be Retrofit-compatible\n        mapOf(\"paramOne\" to \"valueOne\") // Optional string parameters to be sent with every request\n    )\n    // The below is optional; use only if you want crashes to be logged\n    val crashLogger = CrashLogger(\n        this,\n        tree,\n        getString(R.string.crash_log_file), // name of crash log file (i.e. crash.txt)\n        apiConfig\n    )\n    // This will send logs from previous crash to your endpoint if a crash occurred on last run\n    crashLogger.prepareCrashLog()\n    ...\n}\n```\n\n## Optional configuration\n\nYou can control the size and format of the log files by passing a `LoggerConfig` object to the\n`FileLogTree` constructor:\n\n```\nval loggerConfig = LoggerConfig(\n    \"yyyy-MM-dd_HH-mm-ss-SSS\", // fileDateFormat: date format that will appear in log file names\n    \"yyyy-MM-dd HH:mm:ss.SSS\", // logDateFormat: date format that will appear in log entries\n    \"logs\", // logDirName: name of the subdirectory where logs will be saved \n    \"log\", // logPrefix: prefix for log file names\n    \".log\", // logExt: log file extension\n    1000000, // fileMaxLength: Maximum size of individual log files before rollover, in bytes\n    5000000 // totalMaxLength: Maximum size of all log files before old files are deleted\n)\nval tree = new FileLogTree(getFilesDir(), BuildConfig.DEBUG, loggerConfig);\n```\n  \nIf no `LoggerConfig` object is provided, the configuration is defaulted to the values in the example\nabove.\n  \n## Sending logs manually\n\n```\nval sender = LogSender(\n    apiConfig,\n    logManager // This is your FileLogTree instance\n)\nsender.sendLogs(object : LogSenderCallback {\n    override fun onSuccess() {\n        Timber.i(\"Congrats, your logs were sent\")\n    }\n\n    override fun onFailure() {\n        Timber.e(\"Oops, looks like something went wrong\")\n    }\n})\n\nsender.sendLogs(object : LogSenderCallback {\n    override fun onSuccess() {\n        Timber.i(\"Congrats, your logs were sent\")\n    }\n\n    override fun onFailure() {\n        Timber.e(\"Oops, looks like something went wrong\")\n    }\n}, LogSender.ALL_FILES, mapOf(\"extraPart\" to \"extraValue\"))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartmovesystems%2Fandroidfilelogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartmovesystems%2Fandroidfilelogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartmovesystems%2Fandroidfilelogger/lists"}