Giter Club home page Giter Club logo

Comments (5)

luebbe avatar luebbe commented on May 27, 2024 1

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.

from loggerpro.

danieleteti avatar danieleteti commented on May 27, 2024 1

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.
When you pass a filenameformate which doesn't contain placeholders, the filename is not deparated by TAG and all writers writes on the same file. The problem is that current code doesn't check this situation. I added the following check in constructor.

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 TLoggerProSimpleFileAppender.

from loggerpro.

danieleteti avatar danieleteti commented on May 27, 2024

Can you reproduce the error please?

from loggerpro.

TikoTako avatar TikoTako commented on May 27, 2024

Can you reproduce the error please?

Here:
https://github.com/TikoTako/loggerpro-test

from loggerpro.

TikoTako avatar TikoTako commented on May 27, 2024

With TLoggerProSimpleFileAppender and one file the order is correct, also is ok with TLoggerProFileAppender if it use different log files (one each unit)

from loggerpro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.