Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Best way to monitor a log file ?
Forum Updated to NodeBB v4.3 + New Features

Best way to monitor a log file ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 595 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Echiqueur
    wrote on last edited by
    #1

    Hi, I'm developing a small app in which I have to check in real time an updating log file from another program. What is the best way to do this ?

    JonBJ 1 Reply Last reply
    0
    • E Echiqueur

      Hi, I'm developing a small app in which I have to check in real time an updating log file from another program. What is the best way to do this ?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Echiqueur
      There is little detail here, so best answer may vary. Qt has the QFileSystemWatcher Class, fileChanged signal, if you want to know when a file is modified. Or you can just open for read and reads will be satisfied when new data is available (https://stackoverflow.com/questions/2696976/implement-tail-f-in-c). Depends what you are looking for, how data is written to the file, what shared open modes it allows, etc.

      E 1 Reply Last reply
      0
      • JonBJ JonB

        @Echiqueur
        There is little detail here, so best answer may vary. Qt has the QFileSystemWatcher Class, fileChanged signal, if you want to know when a file is modified. Or you can just open for read and reads will be satisfied when new data is available (https://stackoverflow.com/questions/2696976/implement-tail-f-in-c). Depends what you are looking for, how data is written to the file, what shared open modes it allows, etc.

        E Offline
        E Offline
        Echiqueur
        wrote on last edited by
        #3

        @JonB I've tried to use QFileSystemWatcher but I feel like the file is updating too quickly and that it's not working properly. I don't know how I forgot to simply open the file for read lmao, I'm gonna try this. Thanks !

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved