Closed Bug 759548 Opened 14 years ago Closed 5 years ago

Surface UI for saving, sharing, and deleting Android Sync logfiles

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P5)

All
Android
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: nalexander, Unassigned)

References

()

Details

I've always wanted to have a better way to get at Android Sync logfiles. That needs some UI for setting when to log, for sharing captured log files, and for deleting captured logs.
Status: NEW → ASSIGNED
Truth in advertising: I am not actively working on these tickets.
Assignee: nalexander → nobody
Product: Mozilla Services → Android Background Services
Nick, Can you please update this ticket?
Flags: needinfo?(nalexander)
(In reply to Ahmed Khalil from comment #3) > Nick, Can you please update this ticket? Yes! The goal here is to let folks opt-in to writing Sync (and possibly other Background Services) logs to disk, and then to share and see them. Since log files can get large, we need a way to clean them in the background. The pull request linked to is very old, and probably not a great starting point. But a lot of that code landed -- see the Logger class, which all the Background Services use. The Logger settings are inherited by threads, so we can make the Logger capture the file logs (in a thread-safe manner) to solve our "write to disk" need. Opting-in means exposing a preference somewhere. At first, let's do that in the FxAccountStatus{Activity,Fragment}, as a regular old SharedPreference that the FxASyncAdapter can use to determine how to configure it's Logger. Now, sharing -- that's more interesting. At first, let's just make sure that we write the files to a directory in the user's profile. (I'm not quite sure how to get the profile path in the FxASyncAdapter, but we built the GeckoProfiles ContentProvider to expose it.) So if we write into the profile path, then we can just expose the directory full of log files, and use the built in directory browser to list files, view them, and share them using the Quick Share option. Finally, log rotation and cleaning up. We have a pattern in Fennec for cleaning tasks; we could use that.
Flags: needinfo?(nalexander)
So, start with: 1) unconditionally making the FxAccountSyncAdapter write log files anywhere. 2) getting the log files into the Gecko profile directory, or into the App cache directory. 3) checking that we can view the logs in Firefox itself. 4) adding a preference (log level setting?) to FxAStatusActivity, and wiring that up to the log writer. 5) clean logs older than N days, say.
rnewman: back in the day, Android was very concerned about writing log files impacting performance. IIUC, iOS just elected to write logs all the time, and these days I'm not concerned about the perf hit from writing Sync logs. Can you confirm iOS's decision, and add any high-level guidance you want to have reflected in this work? Thanks!
Flags: needinfo?(rnewman)
Yup, log to disk. If you want, expose the option (console and/or file); perf-minded users can switch. I'd encourage you to write into what Android considers a cache directory. That'll take care of emergency cleanup -- the OS will delete. Expiration: I suggest a combination of size and date. We just do size on iOS, but that's because we're lazy. Firing a share intent with recent logs seems like a great approach -- email, save to Dropbox, whatever. Easier than adding browsing.
Flags: needinfo?(rnewman)
Priority: P2 → P3
Product: Android Background Services → Firefox for Android
Re-triaging per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195 Needinfo :susheel if you think this bug should be re-triaged.
Priority: P3 → P5
No assignee, updating the status.
Status: ASSIGNED → NEW
No assignee, updating the status.
No assignee, updating the status.
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.