Closed chomps1 closed 2 years ago
With the latest TLoggerProSimpleFileAppender the solution is quite simple and I can use the filter function to filter different tags. I would close the issue as "won't fix" due to the simple solution. Thank you.
procedure TForm1.Button1Click(Sender: TObject);
var
Lg: ILogWriter;
i: Integer;
begin
Lg := BuildLogWriter([
TLoggerProFilter.Build(
TLoggerProSimpleFileAppender.Create(10, 5,
TPath.Combine(ExtractFileDir(ParamStr(0)), 'LogDir'), [], '%s.%2.2d.log'),
function(ALogItem: TLogItem): boolean
begin
Result := true;
end)
]);
Lg.Info('Test started V1.0!', 'Test'); // first tag 'Test'
for i := 0 to 100 do
Lg.Info('Test LoopCnt: %d!',[i],'Loop'); // second tag 'Loop'
Sleep(2000);
end;
Dear Daniele. An EInOutError occurs in procedure RotateLog if you want to write messages with different tags in one file. The following test produces the error: