Summary | fresh install : Bad log level |
Queue | Horde Base |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | slusarz (at) horde (dot) org |
Requester | rsalmon (at) mbpgroup (dot) com |
Created | 03/30/2010 (5600 days ago) |
Due | |
Updated | 03/30/2010 (5600 days ago) |
Assigned | 03/30/2010 (5600 days ago) |
Resolved | 03/30/2010 (5600 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
Bug #8942: Fix bad log level errorNeed to always use Horde_Core_Log_Logger, even with the null driver,
because priority may need to be converted from a string.
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Binder/Logger.php?rt=horde-git&r1=781076bb734afd0ae58969d64b4762458c3ec7c1&r2=6ce76467ca8142d61eb046e76739702dfd9ff2c7
"default" config file has logging disabled - is that what you were
seeing?
settings :
for f in *.dist; do cp $f `basename $f .dist`; done
"default" config file has logging disabled - is that what you were
seeing?
Bad log level
Details:
The full error message is logged in Horde's log file, and is shown
below only to administrators. Non-administrative users will not see
error details.
Horde_Log_Exception Object
(
[message:protected] => Bad log level
[string:Exception:private] =>
[code:protected] => 0
[file:protected] =>
/var/www/html/git/horde/framework/Log/lib/Horde/Log/Logger.php
[line:protected] => 120
[trace:Exception:private] => Array
(
[0] => Array
(
[file] =>
/var/www/html/git/horde/framework/Core/lib/Horde.php
[line] => 68
[function] => log
[class] => Horde_Log_Logger
[type] => ->
[args] => Array
(
[0] => Horde_Registry: retrieved appcache
with cache ID
horde_registry_appcache|1269942303|e7f88b8f7b9243b2b6f23c766a64bfa8
[1] => DEBUG
[2] => Array
(
[trace] => 2
)
)
)
[1] => Array
(
[file] =>
/var/www/html/git/horde/framework/Core/lib/Horde/Registry.php
[line] => 1472
[function] => logMessage
[class] => Horde
[type] => ::
[args] => Array
(
[0] => Horde_Registry: retrieved appcache
with cache ID
horde_registry_appcache|1269942303|e7f88b8f7b9243b2b6f23c766a64bfa8
[1] => DEBUG
)
)
[2] => Array
(
[file] =>
/var/www/html/git/horde/framework/Core/lib/Horde/Registry.php
[line] => 427
[function] => _loadCacheVar
[class] => Horde_Registry
[type] => ->
[args] => Array
(
[0] => appcache
)
)
[3] => Array
(
[file] =>
/var/www/html/git/horde/framework/Core/lib/Horde/Registry.php
[line] => 354
[function] => _loadApplicationsCache
[class] => Horde_Registry
[type] => ->
[args] => Array
(
[0] =>
)
)
[4] => Array
(
[file] =>
/var/www/html/git/horde/framework/Core/lib/Horde/Registry.php
[line] => 179
[function] => __construct
[class] => Horde_Registry
[type] => ->
[args] => Array
(
[0] => 0
)
)
[5] => Array
(
[file] => /var/www/html/horde/index.php
[line] => 14
[function] => appInit
[class] => Horde_Registry
[type] => ::
[args] => Array
(
[0] => horde
[1] => Array
(
[authentication] => none
[nologintasks] => 1
)
)
)
)
[previous:Exception:private] =>
)
to date with Git?
Bug #8937)...disabled.
I created a patch inspired from
Bug #8937which fixes our issue :--- Logger.php.org 2010-03-30 16:14:38.000000000 +0200
+++ Logger.php 2010-03-30 16:16:45.000000000 +0200
@@ -96,6 +96,12 @@
throw new Horde_Log_Exception('No handlers were added');
}
+
+ if (is_string($level)) {
+ $level = defined('Horde_Log::' . $level)
+ ? constant('Horde_Log::' . $level)
+ : Horde_Log::INFO;
+ }
// Create an event array from the given arguments.
if (is_array($event)) {
// If we are passed an array, it must contain 'message'
State ⇒ Feedback
config file has logging disabled - is that what you were seeing?
Also, it sounds like a different issue, but just in case, are you up
to date with Git? There were some recent fixes to logging - especially
Bug #8937)...Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ fresh install : Bad log level
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
re-installing from scratch horde, I get the following error
(horde/test.php) using the default config files :
Fatal error :
Bad log level
[ligne 120 de /var/www/html/git/horde/framework/Log/lib/Horde/Log/Logger.php]
output of $this and $event gives :
Horde_Log_Logger Object
(
[_levels:Horde_Log_Logger:private] => Array
(
[0] => EMERG
[1] => ALERT
[2] => CRIT
[3] => ERR
[4] => WARN
[5] => NOTICE
[6] => INFO
[7] => DEBUG
)
[_handlers:Horde_Log_Logger:private] => Array
(
[0] => Horde_Log_Handler_Null Object
(
[_options:protected] => Array
(
)
[_filters:protected] => Array
(
)
)
)
[_filters:Horde_Log_Logger:private] => Array
(
)
)
Array
(
[message] => Hook pushapp in application horde not called.
[level] => DEBUG
)
If I add the following lines to conf.php, everything works fine:
$conf['log']['priority'] = 'DEBUG';
$conf['log']['ident'] = 'HORDE';
$conf['log']['name'] = '/tmp/horde.log';
$conf['log']['params']['append'] = true;
$conf['log']['params']['format'] = 'default';
$conf['log']['type'] = 'file';
$conf['log']['enabled'] = true;