react-native-file-logger icon indicating copy to clipboard operation
react-native-file-logger copied to clipboard

Add ability to zip the logs when rolling date the files

Open abouquet opened this issue 3 years ago • 6 comments

There can be lots of logs file and it may be hard to send it by mail if not zipped.

I know that for Android, this library is using logback which can have a built in RollingFileAppender. But we should maybe be able ton configure it in javascript side

abouquet avatar Sep 23 '22 08:09 abouquet

For IOS, maybe a bit more tweaking see : https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/LogFileManagement.md

abouquet avatar Sep 23 '22 08:09 abouquet

Got a PR to manage zip files

https://github.com/BeTomorrow/react-native-file-logger/pull/46

Had to update gradle stuff to make it working 🤔

abouquet avatar Sep 23 '22 12:09 abouquet

Please tell me if you wanna merge it, it's a high priority for us, I want to know if I have to publish it to our internal repository in the meantime :)

abouquet avatar Sep 27 '22 07:09 abouquet

Hello, I have noted your request to be able to zip the files but as I already answered in a previous issue our vision is to be able to view the files as easily as possible i.e. directly from the mail clients (even from a smartphone). That's why we don't use zip currently.

I understand the need and will probably add a zip option one day, but it's not planned in the short term for now.

And I won't merge your PR as it is because there is only the Android part implemented and I want all the features of the lib to be the same on iOS and Android 🙂

alois-beto avatar Sep 28 '22 15:09 alois-beto

Thanks for your answer, I understand your vision, that's why I made this as a config parameter. I have indeed made it as zipped by default, we may fallback to unzipped by default but also be able to zip it if required.

It's for sure I'm not the only which needs this requirement.

Apps logs can be very verbose on Android (don't know if it's the case on IOS), and not lots of email provider can let us send big emails. Zipped files can save us lots of space...

For your second argument, I would gadly do it for IOS, but don't have an appropriate dev environnement (and skill) to do it. If only someone else could to do this part, we could maybe unblock this PR ?

abouquet avatar Sep 28 '22 16:09 abouquet

We also need log files zipped but I don't expect this package to handle it. It's really simple to use a combination of react-native-zip-archive, expo-file-system and expo-sharing to accomplish this (assuming expo).

Plus we need to add other supporting documents to the zip archive, so if this library handled zipping we wouldn't event use it.

Just my 2¢

Cheers

josmithua avatar May 29 '24 00:05 josmithua