-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not writing logs to file in release mode #43
Comments
Hi, it seems that you have not provided a custom filter, by default the Logger(
filter: ProductionFilter(),
// ...
) |
Even if the code is modified, the log cannot be written to the file in release mode, but it can be written to the file normally in debug mode. Method to reproduce this problem: package a release mode apk file and install the apk on the phone. The log cannot be written to the file. Even if I use the following code, it doesn't work
|
Hi @zzdota, I tried to reproduce your problem but wasn't able to identify any issues. I created a FileOutput with a File in the Test Code: late File logFile;
Directory applicationDir = await getApplicationDocumentsDirectory();
logFile = File("${applicationDir.path}${Platform.pathSeparator}test.log");
// ...
static final Logger log = Logger(
filter: ProductionFilter(),
output: !kIsWeb
? MultiOutput([
Logger.defaultOutput(),
FileOutput(file: logFile),
])
: Logger.defaultOutput(),
); |
First of all, I admit that you are right, |
Hi @zzdota, again, I tried to reproduce it and couldn't find any problem. Another question, as the device file explorer isn't available for release builds, how do you check if the file exists? |
So, If
how can you be sure that
Is the device need to be root? |
Hi @magic3584, my app tells me that. I just coded a simple file check that tells me if the log file exists and what its content is. |
@Bungeefan |
Code :
The text was updated successfully, but these errors were encountered: