Read the statement by Michael Teeuw here.
Looking for a module to display logs in realtime
-
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. -
@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
-
@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.