I've often needed access to my error.log from a machine that did not have an SSH client installed. I created this little hack that can live within a static page:
global $_CONF;
require_once $_CONF['path_system'] . 'classes/downloader.class.php';
$dMgr = new downloader();
$dMgr->setPath($_CONF['path_log']);
$dMgr->_setAvailableExtensions(array('log' => 'text/plain'));
$dMgr->setAllowedExtensions(array('log' => 'text/plain'));
$dMgr->downloadFile('error.log');
if ($dMgr->areErrors()) {
$dMgr->printErrors();
}
That's it. Simple, elegant and as secure as Geeklog is.
Comments (0)