[GUIDE] Add custom log files to WebUI

    • Offizieller Beitrag

    If you want to display additional custom log files in the WebGUI at 'Diagnostics | System Logs' then you have to do the following.


    Create a file called 99mylogspecs.inc in /usr/share/openmediavault/engined/inc. Here you can add your log file specifications. An example for a simple log file may look like this:

    The description of the structure can be found here. The first argument of the registerSpecification must be a unique identifier. This must be used later in the JavaScript code, too.


    If you want to retrieve the data from an external application, e.g. journalctl, then a log file specification should look like this


    To take your changes into action you simply have to restart the OMV engine.

    Bash
    monit restart omv-engined

    During development you should manually start the engine to see if there are any errors. They will be displayed immediatelly.

    Bash
    omv-engined -d -f

    More examples for the backend part can be found here.


    To display the log file in the WebUI, you have to add a JavaScript file at /var/www/openmediavault/js/omv/module/admin/diagnostic/log/plugin, e.g. MyLogFile.js.


    The name of the JavaScript class must be unique. By default it is the same name as used in the registerSpecification method above. The same name must be defined for the id and rpcParams.id attributes. The stateId attribute must be an unique UUIDv4. The rpcFields attribue describes the log data that is returned by the RPC. The columns attribute is an array of columns to be displayed. The Sencha ExtJS API can be found here.


    More examples can be found here.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!