LogViewPlus Support

Tailing memory mapped files of fixed size and filled with zero's

https://www.logviewplus.com/forum/Topic1822.aspx

By kve - 18 Jul 2023

Hi,
Our logging system works with memory mapped files. It initially creates a file of 3MB filled with zero's (bytes with value zero, not the ascii code for the character 0). Gradually the file is filled up with readable text. As the file is full, the next file is created in the same manner.
a couple of questions :
- Does logviewplushave a problem with the zero's?
- most editors that watch files for changes don't pick up the additional changes once a file is opened (ea vs code, sublime editor) - you need to manually refres/reload a file to tail it. What does logviewplus do?
- a log can be split over two files, is the merging of files done before the parsing or after?
ea.
file mks_170_trc.txt ends with
18.07.2023 08:41:03,491 =====>>>>>=====>>>>>=====>>>>> T<24461> von <ComMKSUCBSrv> erhalten. Ausführung Handler <99> ....
ResultValue von UCB <SL-V
file mks_171_trc_txt starts with
MT> erhalten., Prozess <99297922>, Subprozess <6490>, OpCode <JAC>.
    ResultValue <A96EE7534044D4D8970749873FFA3560> eingefügt.
18.07.2023 08:41:03,538 =====>>>>>=====>>>>>=====>>>>> T<18116> von <ComMKSAsyncDBAccess> erhalten. Ausführung Handler <336> ....

Thanks in advanced,
Kurt


By LogViewPlus Support - 18 Jul 2023

Hi Kurt,

LogViewPlus has not been tested against a memory mapped file.  I assume your mapped file works similar to any other file in the file system, but the file read request reads from memory rather than disk.  It sounds like the file size is fixed and will not change as log entries are being written.  Is this correct?

LogViewPlus monitors files by checking the size.  If the file size is fixed, I don't think the zeroed out bytes would necessarily be a problem, but there would be a problem when new data is written where the data was previously empty.  If the bytes of the file are pre-allocated, you may need to frequently refresh the view. 

If the file size is changing, then LogViewPlus should be able to identify where new data exists and the refresh should be unnecessary.

LogViewPlus also assumes log entries are written as a whole.  When LogViewPlus cannot parse a log entry, one of two situations occurs:
1. If the log entry is at the beginning of a file, it will be appended to the first complete log entry.
2. Otherwise, it will be appended to the previous log entry.

In this way, LogViewPlus cannot 'lose' data.  The information can always be found by a text search or selecting the appropriate log entry, but it may not appear in the log entry grid.  In the example provided, both append options will be used and the 'complete' log entry will not be parsed or available in the log entry grid.

Hope that helps,

Toby
By kve - 19 Jul 2023

ok, thanks for the swift repl