Welcome to Geeklog, Anonymous Sunday, July 21 2024 @ 06:40 am EDT

Staticpage to Access error.log

  • Wednesday, January 18 2006 @ 11:06 am EST
  • Contributed by:
  • Views: 11,349
Geeklog 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:
  1. Go to the staticpage admin screen and hit the "Create New" button.
  2. In the PHP drop-down be sure to select "execute PHP"
  3. For the group down-down, be sure to select "Root" and be sure to uncheck teh Read flag for Members and Anonymous (NOTE: this is important for security)
  4. In the "content" textarea add the following:
    global $_CONF;
    require_once $_CONF['path_system'] . 'classes/downloader.class.php';
    $dMgr = new downloader();
    $dMgr->_setAvailableExtensions(array('log' => 'text/plain'));
    $dMgr->setAllowedExtensions(array('log' => 'text/plain'));
    if ($dMgr->areErrors()) {
  5. Save the page

That's it. Simple, elegant and as secure as Geeklog is.