anchor.diff:  procedure TmFilePublisher.Publish(aContext, aLevel, aMessage: string; aDate: TDateTime);
   var
     s: RawByteString;
  -begin
  +  actualFileName : String;
  +begin
  +  if FFileName = '' then
  +    FFileName:= IncludeTrailingPathDelimiter(FFileFolder) + FFileNameTemplate;
  +
     if FFileName <> '' then
     begin
  +    if FCycleEveryDay and (FFileDay <> trunc(Date)) then
  +    begin
  +      if Assigned(FFileStream) then
  +      begin
  +        FFileStream.WriteByte(10);
  +        FreeAndNil(FFileStream);
  +      end;
  +      ClearOldLogFiles;
  +    end;
  +
       if not Assigned(FFileStream) then
       begin
  -      if FileExists(FFileName) then
  -      begin
  -        (*
  -        if (FMaxFileSizeInMb > 0) and ((FileUtil.FileSize(FFileName) div 1024) > FMaxFileSizeInMb) then
  -        begin
  -          RenameFile(FFileName, FFileName + '.bak');
  -        end;
  -        *)
  -        FFileStream := TFileStream.Create(FFileName, fmOpenWrite);
  +      if FCycleEveryDay then
  +      begin
  +        FFileDay:= trunc(Date);
  +        actualFileName:= EncodeFileName(FFileDay);
  +        ClearOldLogFiles;
  +      end
  +      else
  +        actualFileName:= FFileName;
  +
  +      if FileExists(actualFileName) then
  +      begin
  +        FFileStream := TFileStream.Create(actualFileName, fmOpenWrite);
           FFileStream.Seek(0, soFromEnd);
         end
         else
         begin
  -        FFileStream := TFileStream.Create(FFileName, fmCreate);
  +        FFileStream := TFileStream.Create(actualFileName, fmCreate);
           AddUTF8BOMToStream(FFileStream);
         end;
       end;
  
positive.code:   end;
    {$endif}
  
    TmFilePublisher = class (TmLogPublisher)
    strict private
      FCurrentLevel : TmLogMessageLevel;
      FFileName : TFileName;
      FFileStream : TFileStream;
      FMaxFileSizeInMb : integer;
    public
      procedure AfterCreate; override;
      destructor Destroy; override;
  
negative.code: implementation
  
  uses
    FileUtil, LazFileUtils,
    mUtility, mMathUtility;
  
  { TmConsolePublisher }
  
  