6.0.0-beta1
7/29/25

[#8942] fresh install : Bad log level
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

History
03/30/2010 06:25:39 PM Michael Slusarz Assigned to Michael Slusarz
State ⇒ Resolved
 
03/30/2010 06:25:23 PM CVS Commit Comment #5 Reply to this comment
Changes have been made in Git for this ticket:

Bug #8942: Fix bad log level error
Need 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
03/30/2010 01:26:53 PM rsalmon (at) mbpgroup (dot) com Comment #4 Reply to this comment
What were the log settings before you added those lines? The 
"default" config file has logging disabled - is that what you were 
seeing?
just I case I wasn't really clear, horde/config contained the default 
settings :
for f in *.dist; do cp $f `basename $f .dist`; done
03/30/2010 01:22:29 PM rsalmon (at) mbpgroup (dot) com Comment #3 Reply to this comment
What were the log settings before you added those lines? The 
"default" config file has logging disabled - is that what you were 
seeing?
With $conf['log']['enabled'] set to false, I always get : Fatal error
  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] =>
)
Also, it sounds like a different issue, but just in case, are you up 
to date with Git?
Yes
There were some recent fixes to logging - especially Bug #8937)...
It could be related, the issue I'm having only occurs when logging is 
disabled.

I created a patch inspired from Bug #8937 which 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'




03/30/2010 12:22:27 PM Michael Rubinsky Comment #2
State ⇒ Feedback
Reply to this comment
What were the log settings before you added those lines? The "default" 
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)...
03/30/2010 10:06:24 AM rsalmon (at) mbpgroup (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ fresh install : Bad log level
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
using php-5.3.2, httpd-2.2.3

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;


Saved Queries