From 820cd0fb75bac88b4debe8f3fb28c1118b8587fa Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 16 Oct 2011 20:49:14 +0200 Subject: provide a logging mechanism --- settings/log.php | 41 +++++++++++++++++++++++++++++++++++++++++ settings/templates/log.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 settings/log.php create mode 100644 settings/templates/log.php (limited to 'settings') diff --git a/settings/log.php b/settings/log.php new file mode 100644 index 00000000000..e181a5a4967 --- /dev/null +++ b/settings/log.php @@ -0,0 +1,41 @@ +. + * + */ + +require_once('../lib/base.php'); +OC_Util::checkAdminUser(); + +// Load the files we need +OC_Util::addStyle( "settings", "settings" ); +OC_Util::addScript( "settings", "apps" ); +OC_App::setActiveNavigationEntry( "core_log" ); + +$entries=OC_Log::getEntries(); + +function compareEntries($a,$b){ + return $b->time-$a>time; +} +usort($entries, 'compareEntries'); + +$tmpl = new OC_Template( "settings", "log", "user" ); +$tmpl->assign('entries',$entries); + +$tmpl->printPage(); diff --git a/settings/templates/log.php b/settings/templates/log.php new file mode 100644 index 00000000000..467f594186c --- /dev/null +++ b/settings/templates/log.php @@ -0,0 +1,29 @@ + + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ +$levels=array('DEBUG','INFO','WARN','ERROR','FATAL'); +?> + +
+ +
+ + + + + + + + + +
+ level];?> + + app;?> + + message;?> + + l('datetime',$entry->time);?> +
\ No newline at end of file -- cgit v1.2.3