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
FileAppender write in the wrong position. #72
Comments
Can you reproduce the error please? |
|
I have seen this offset sometimes as well, but never took a closer look. I attributed it to two instances of the application running in parallel and writing into the same log file (when the PID is not used in the file name). But @TikoTako 's log shows that it is obviously written from the same thread. |
I deeply investigated the problem (I never seen it in years).The problem is the file name format which doesn't contain placeholders so output files are overlapped. procedure TLoggerProFileAppenderBase.CheckLogFileNameFormat(
const FileNameFormat: String);
var
lExt: string;
begin
lExt := Format(FileNameFormat, ['X','Y','Z']);
if lExt = FileNameFormat then {means that FileNameFormat doesn't contain place holders }
begin
raise ELoggerPro.CreateFmt(
'FileName Format "%s" doesn''t contain required placeholders. [HINT: Just as an example, the DEFAULT_FILENAME_FORMAT is "%s"]',
[FileNameFormat, DEFAULT_FILENAME_FORMAT]);
end;
end;
Can you check if, using the repo version without your changes, it works? If you don't want to have separate files by tag, just use |
With TLoggerProSimpleFileAppender and one file the order is correct, also is ok with TLoggerProFileAppender if it use different log files (one each unit) |
0d39e1d1 New LogLevel: FATAL 5248b9de Improved fileformatname check 657a539d danieleteti/loggerpro#79 67729f57 danieleteti/loggerpro#72 f05a91a6 danieleteti/loggerpro#73 3c805c0f Merge pull request #71 from luebbe/master 3a790459 Fixes #70 Add test to expose #70 git-subtree-dir: lib/loggerpro git-subtree-split: 0d39e1d1549d42fa20b71503eed944043771b7bb
Hello,
i have a global ILogWriter that is called from the dpr and from a main unit.
Before the program close i have one last debug write on the dpr, when that happens it write back in the last position it had on the last write (done in the dpr), so it overwrite some of the log done while in the main unit.
The text was updated successfully, but these errors were encountered: