{"id":32151544,"url":"https://github.com/crspybits/swift-log-file","last_synced_at":"2026-02-21T03:02:30.937Z","repository":{"id":63907260,"uuid":"300922305","full_name":"crspybits/swift-log-file","owner":"crspybits","description":"A simple file logger based on swift-log","archived":false,"fork":false,"pushed_at":"2024-02-13T19:01:20.000Z","size":20,"stargazers_count":48,"open_issues_count":2,"forks_count":17,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-14T16:40:41.332Z","etag":null,"topics":["filelogger","ios"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/crspybits.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":"2020-10-03T16:12:58.000Z","updated_at":"2025-12-23T02:01:49.000Z","dependencies_parsed_at":"2022-11-29T07:02:09.075Z","dependency_job_id":null,"html_url":"https://github.com/crspybits/swift-log-file","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/crspybits/swift-log-file","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crspybits%2Fswift-log-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crspybits%2Fswift-log-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crspybits%2Fswift-log-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crspybits%2Fswift-log-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crspybits","download_url":"https://codeload.github.com/crspybits/swift-log-file/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crspybits%2Fswift-log-file/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29672262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"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":["filelogger","ios"],"created_at":"2025-10-21T10:47:19.544Z","updated_at":"2026-02-21T03:02:30.933Z","avatar_url":"https://github.com/crspybits.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swift-log-file\n\n[SwiftLog](https://github.com/apple/swift-log) compatible file log handler.\n\nThis currently only supports iOS.\n\n## Example: Just logging to a file\n\n```swift\nlet logFileURL = URL(/* your local log file here */)\nlet logger = try FileLogging.logger(label: \"Foobar\", localFile: logFileURL)\nlogger.error(\"Test Test Test\")\n```\n\n## Example: Logging to both the standard output (Xcode console if using Xcode) and a file.\n\n```swift\nlet logFileURL = try getDocumentsDirectory().appendingPathComponent(logFileName)\nlet fileLogger = try FileLogging(to: logFileURL)\n\nLoggingSystem.bootstrap { label in\n    let handlers:[LogHandler] = [\n        FileLogHandler(label: label, fileLogger: fileLogger),\n        StreamLogHandler.standardOutput(label: label)\n    ]\n\n    return MultiplexLogHandler(handlers)\n}\n\nlet logger = Logger(label: \"Test\")\n```\n\nNote in that last example, if you use `LoggingSystem.bootstrap`, make sure to create your `Logger` *after* the  `LoggingSystem.bootstrap` usage (or you won't get the effects of the `LoggingSystem.bootstrap`).\n\n## Example: Using XCGLogger\n\n[XCGLogger](https://github.com/DaveWoodCom/XCGLogger.git) supports rotating file logs amongst other features.\n\n```swift\nlet logFileURL = URL(/* your local log file here */)\nlet xcgLogger = /* Make your XCGLogger, using logFileURL */\nlet logger = XCGLogging.logger(label: \"Test\", logger: xcgLogger)\nlogger.error(\"Test Test Test\")\n```\n\n## Example: Logging to both the standard output (Xcode console if using Xcode) and a file using XCGLogger.\n\n```swift\nlet logFileURL = try getDocumentsDirectory().appendingPathComponent(logFileName)\nlet xcgLogger = /* Make your XCGLogger, using logFileURL */\n\nLoggingSystem.bootstrap { label in\n    let handlers:[LogHandler] = [\n        XCGLoggerHandler(label: label, logger: xcgLogger),\n        StreamLogHandler.standardOutput(label: label)\n    ]\n\n    return MultiplexLogHandler(handlers)\n}\n\nlet logger = Logger(label: \"Test\")\n```\n\nFor more examples, see the unit tests and refer to [apple/swift-log's README](https://github.com/apple/swift-log#the-core-concepts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrspybits%2Fswift-log-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrspybits%2Fswift-log-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrspybits%2Fswift-log-file/lists"}