magento-hackathon / Hackathon_MageMonitoring

Magento Extension to get health of your Magento installation (Server, PHP, APC, Logs, Rewrites, Modules version installed ...)
Open Software License 3.0
131 stars 38 forks source link

Better to make dynamic tabs for var/log/*.log #35

Open MagePsycho opened 9 years ago

MagePsycho commented 9 years ago

I can see log viewer only available for system.log and exception.log(hard-coded in config.xml) It's better to have option to make log view dynamic or config.xml based.

edannenberg commented 9 years ago

You can instance another log viewer via a config.xml of your choice:

<default>
        <!-- Insert a new tab with generic tail widget that watches our custom log file -->
        <magemonitoring>
            <tabs>
                <my_tab>
                    <label>My Tab</label>
                    <title>My Tab</title>
                    <display_prio>500</display_prio>
                    <widgets>
                      <my_log>
                        <impl>Hackathon_MageMonitoring_Model_Widget_Log_Tail</impl>
                        <title>My Log</title>
                        <file_path>module/path/file.log</file_path>
                        <color>warning</color>
                        <collapsed>1</collapsed>
                        <display_prio>10</display_prio>
                      </my_log>
                    </widgets>
                </my_tab>
            </tabs>
        </magemonitoring>
</default>
edannenberg commented 9 years ago

I guess you mean using the log file names configured as system/exception in Magento per default. Makes sense and should be fairly simple to implement.

Modify Model/Widget/Log/Tail.php::initConfig() and remove defaults in config.xml if you got a bit time on your hands for a PR. Currently a bit short myself.