We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41900fc commit ea0bfe9Copy full SHA for ea0bfe9
lib/src/outputs/advanced_file_output.dart
@@ -179,10 +179,10 @@ class AdvancedFileOutput extends LogOutput {
179
await _file.length() > _maxFileSizeKB * 1024) {
180
// Rotate the log file
181
await _closeSink();
182
- await _file.rename('$_path/${_fileNameFormatter(DateTime.now())}');
+ await _file.copy('$_path/${_fileNameFormatter(DateTime.now())}');
183
await _deleteRotatedFiles();
184
- // Reset file ref to "latest"
185
- _file = maxFileSizeKB > 0 ? File('$path/$latestFileName') : File(path);
+ // Clear contents of "latest"
+ await _file.writeAsString("", mode: FileMode.write, flush: true);
186
await _openSink();
187
}
188
} catch (e, s) {
0 commit comments