Writing user-accessible log files - where?

I’d like to set up a logging system so that users can send more useful bug reports along with app-written logs. My plan is for them to find the logs files easily and email them to me manually. This is for users I cam in direct contact with, but do no have a great deal of technical experience, and certainly no access to Xcode or Android Studio.

I believe I can write a service that will append to a file correctly and record all the things I think are useful, but I am stuck as to where to write that file.

it looks the the documentsDirectory is a good place for iOS, since it is visible in iTunes (on MacOS) and presumably there is a Windows way of accessing them too. But what about for Android, the directories seem centred on external storage and I have no idea if the users will have that set up.

I went with the capacitor plugin and the ‘Documents’ directory. On Android I can find the files using the Files app that came preinstalled. On iOS I had to add these two settings to my info.plist and then the Files app showed the file and iTunes on my Mac shows them too.

<key>UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>

why try and reinvent the wheel when it’s already created? Users are not going to send crash logs, it’s too much of a hassle. Use sentry instead:

We have dedicated users on the line, they’re going to be sending crash reports to me personally.