MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Looking for a module to display logs in realtime

    Scheduled Pinned Locked Moved Unsolved Requests
    3 Posts 2 Posters 45 Views 2 Watching
    Loading More Posts
    • 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.
    • M Offline
      MyMirror
      last edited by

      Hello everyone,
      Is there already a module that always displays the last 20 lines of a log file?
      It would be desirable to have parameters for:

      • the number of lines to be displayed
      • the log file specification (including the complete path)
      • the option to adjust the font size

      Example
      {
      module: ‘MMM-Log’,
      position: ‘bottom_center’,
      config: {
      log: ‘/var/log/syslog’,
      lines: 20,
      fontsize: ‘12’,
      maxWidth: ‘25%’, // Sizes the window
      }
      },
      Thank you for your tips and advice.

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @MyMirror
        last edited by sdetweil

        @MyMirror I’m not aware of a module that does this

        But it shouldn’t be hard to create

        tail /f /n:xxx filename

        Can get the data

        nodejs exec in the node_helper can launch tail and capture its stdout data

        Then use sendSocketNotification to send the data up to the browser side of the module to display, where the fontsize would be used

        The data will have to get its line ends (cr/lf) replaced by web line ends (
        )

        I think it would be better to put the fontsize in css file to keep all the styling options in one place. Module adds a class name to the div holding the data, and specifies a provided css file that has the class defined with the styles you want

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        M 1 Reply Last reply Reply Quote 0
        • M Offline
          MyMirror @sdetweil
          last edited by

          @sdetweil
          Hi Sam,

          I haven’t written a module yet and I’m not very familiar with Linux – and even less so with nodejs, css and all the other stuff.
          Maybe someone out there would like to try their hand at programming such a module.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy