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

Logged file contains garbage text with some strange `PARSER_ERROR` error

Open JJSLIoT opened this issue 1 year ago • 5 comments

I can see that the logs are perfectly fine when printed in the debug console. But for some reason when I check the log file in release mode, it contains such below garbage text throughout the file:

%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR[msg]%PARSER_ERROR[n]%PARSER_ERROR
......

I started facing this issue abruptly, all my dependencies are unchanged. I am using an older version of react-native-file-logger: v0.3.0. I checked v0.4.0 version of this module as well, same issue there. v0.5.4 has some problems with pod install on RN version 0.68.7 that my project is using.

I observed this issue on both platforms: Android and iOS. But seems more prominent on Android.

JJSLIoT avatar Apr 05 '24 09:04 JJSLIoT

Hello, PARSER_ERROR means that logback cannot encode your logs. This particular error is specific to Android, but you might get something similar in the iOS part. It seems that you are logging unrecognized object (maybe not UTF-8 characters?).

Can you provide a minimal repository that replicate the issue ?

fdrault avatar Apr 08 '24 08:04 fdrault

@fdrault Thank you for the response, I will try to create a minimal repository and share it here.

JJSLIoT avatar Apr 30 '24 04:04 JJSLIoT

I upgraded react-native version to 0.71.19, and the issue is no longer observed now. Closing this issue for now.

JJSLIoT avatar Jul 09 '24 04:07 JJSLIoT