Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

RollingFileAppender does not correctly append on device restart #7

Open
CrazyRangerBob opened this issue Jul 8, 2020 · 0 comments
Open

Comments

@CrazyRangerBob
Copy link

When using RollingFileAppender the log file will restart from the second logging line when the device is restarted, rather than correctly appending and rolling.

Solution appears to be to switch lines 116 and 117 in RollingFIleAppender.cpp getFile() to

_maxRowLength = readMaxRowLength();
_file.seek(readOffset(), SeekSet);

Otherwise the FS position pointer is left in an incorrect position by the "readMaxRowLength()" operation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant