6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
2/25/26
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#10773] Improve logging in Horde_Db
*
Your Email Address
*
Spam protection
Enter the letters below:
. . __ . ..___..__. | |/ `|\ | | [__] |__|\__.| \| | | |
Comment
> Due to the design of the Log class, we ALWAYS generate the log > message and send it to the Log class, even if the log level means it > will never be output to any handler. > > However, this is crippling in the case of large log outputs. Not > only do we need to allocate memory for the string itself, but the > memory needs are at a minimum doubled since we generate a > debug_backtrace() in the Horde Core log handler, and this > debug_backtrace will include the entire contents of the log message. > > My example: attaching a 2 MB file to an email message is taking > upwards of 80+ MB /regardless/ of the Log setting. Totally disabling > logging in the DB library lowers the memory usage to around 50 MB. > This 30 MB difference is because the DB logger is logging the ENTIRE > query string sent to the server. In my case, because I am using > postgres, the data string size is quadrupled due to bytea escaping so > the log message is 9MB. > > Even for DEBUG logging, this is ridiculous. And for those not using > debug logging, they have to pay this penalty for no reasons. Several > thoughts: > > 1) A way to pre-query the logger to see if we should even go through > the trouble of creating a log message. Useful in cases where log > message generation is potentially expensive. > 2) Remove query logging in Db library, even for DEBUG level. Add > parameter to specifically request full query logging.
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers