$file_name (".__('File is too large than PHP memory allocated in the system.').')';
echo '
'.__('The preview file is imposible.').'
';
} else if ($file_size > ($config['max_log_size'] * 1000)) {
$data = file_get_contents($file_name, false, null, ($file_size - ($config['max_log_size'] * 1000)));
echo "$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).'
';
echo "
';
} else {
$data = file_get_contents($file_name);
echo "$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).'
';
echo "
';
}
}
}
function pandoralogs_extension_main()
{
global $config;
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Setup Management'
);
include 'general/noaccess.php';
return;
}
ui_print_page_header(__('System logfile viewer'), 'images/extensions.png', false, '', true, '');
echo ''.__('Use this tool to view your %s logfiles directly on the console', get_product_name()).'
';
echo ''.__('You can choose the amount of information shown in general setup (Log size limit in system logs viewer extension), '.($config['max_log_size'] * 1000).'B at the moment').'
';
$logs_directory = (!empty($config['server_log_dir'])) ? io_safe_output($config['server_log_dir']) : '/var/log/pandora';
// Do not attempt to show console log if disabled.
if ($config['console_log_enabled']) {
view_logfile($config['homedir'].'/log/console.log');
}
view_logfile($logs_directory.'/pandora_server.log');
view_logfile($logs_directory.'/pandora_server.error');
}
extensions_add_godmode_menu_option(__('System logfiles'), 'PM', '', null, 'v1r1');
extensions_add_godmode_function('pandoralogs_extension_main');