Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/src/outputs/advanced_file_output.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ class AdvancedFileOutput extends LogOutput {
await _file.length() > _maxFileSizeKB * 1024) {
// Rotate the log file
await _closeSink();
await _file.rename('$_path/${_fileNameFormatter(DateTime.now())}');
await _file.copy('$_path/${_fileNameFormatter(DateTime.now())}');
await _deleteRotatedFiles();
// Clear contents of "latest"
await _file.writeAsString("", mode: FileMode.write, flush: true);
await _openSink();
}
} catch (e, s) {
Expand Down
Loading