unknown
5/18/25

[#8937] Horde::logMessage calls Horde_Log_Logger::log bad values
Summary Horde::logMessage calls Horde_Log_Logger::log bad values
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners slusarz (at) horde (dot) org
Requester jonathan (at) findyourfans (dot) com
Created 03/27/2010 (5531 days ago)
Due
Updated 03/30/2010 (5528 days ago)
Assigned 03/27/2010 (5531 days ago)
Resolved 03/30/2010 (5528 days ago)
Milestone
Patch Yes

History
03/30/2010 09:26:56 AM Jan Schneider State ⇒ Resolved
 
03/29/2010 08:53:32 PM Michael Slusarz Comment #5 Reply to this comment
Well, Horde::logMessage calls Horde_Log_Logger::log not 
Horde_Core_Log_Logger::log, despite the comment's reference to the 
latter.
This is incorrect.  Horde::logMessage() calls the injector and asks 
for the instance bound to 'Horde_Log_Logger'.  This binder 
(Horde_Core_Binder_Logger) returns a Horde_Core_Log_Logger instance 
(see Core/lib/Horde/Core/Binder/Logger.php).

The injector pattern is necessary to ensure that the Horde_Log package 
is not dependent on any given Horde installation - in other words, 
Horde_Log can be used independently of Horde the application.

Horde_Log requires an integer input for log() - mainly because this 
maps with other logger API interfaces.  However, using Horde_Log 
integer logging constants is troubling in Horde since the log level is 
defined in a configuration file, which may be loaded before Horde_Log 
itself is available.  Thus, the need to allow strings to be used for 
log levels within Horde.
03/27/2010 02:06:56 AM jonathan (at) findyourfans (dot) com Comment #4 Reply to this comment
No - it is perfectly acceptable to pass a string to the logger.   
Horde_Core_Log_Logger should do the conversion.  However, there was 
a certain case where this conversion wasn't happening and that has 
been fix.  Additionally, this same case was exiting the entire 
script, which wasn't necessary.
Well, Horde::logMessage calls Horde_Log_Logger::log not 
Horde_Core_Log_Logger::log, despite the comment's reference to the 
latter. Horde_Core_Log_Logger extends Horde_Log_Logger, changing the 
behavior of the log method. I'm not sure exactly how this should be 
fixed, but the inconsistency between those two log methods seems 
unnecessarily confusing.
03/27/2010 01:55:36 AM Michael Slusarz Comment #3
Assigned to Michael Slusarz
State ⇒ Feedback
Priority ⇒ 2. Medium
Reply to this comment
No - it is perfectly acceptable to pass a string to the logger.   
Horde_Core_Log_Logger should do the conversion.  However, there was a 
certain case where this conversion wasn't happening and that has been 
fix.  Additionally, this same case was exiting the entire script, 
which wasn't necessary.

See if these changes fix things for you.
03/27/2010 01:54:20 AM Michael Slusarz Deleted Original Message
 
03/27/2010 12:44:48 AM jonathan (at) findyourfans (dot) com Comment #1
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ Horde::logMessage calls Horde_Log_Logger::log bad values
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ Yes
New Attachment: horde_log.patch
State ⇒ Unconfirmed
Reply to this comment
Trying to install Horde4 from current GIT kept giving me "Bad log 
level" error pages until I tracked down the problem in the Horde class 
in "framework/Core/lib/Horde.php" where the logMessage method was 
passing Horde_Log_Logger::log a $priority string instead of the 
integer $level it
expected.

Saved Queries