<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Improve / standarize / clean up log messages</title> 
  <pubDate>Thu, 09 Apr 2026 18:03:11 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7829</link> 
  <atom:link rel="self" type="application/rss+xml" title="Improve / standarize / clean up log messages" href="https://bugs.horde.org/ticket/7829/rss" /> 
  <description>Improve / standarize / clean up log messages</description> 
 
   
   
  <item> 
   <title>Scenario

--------

Most of &quot;my&quot; servers / applications are </title> 
   <description>Scenario

--------

Most of &quot;my&quot; servers / applications are logging to syslog, and syslog is sent to central log servers. All logs are then going to be being parsed / aggregated / archieved / rotated / whatever. This work is done either by generic or personalized log parsers and log aggregation daemons.



I&#039;m going to put our beautiful new (D)IMP-based webmail into production next week, and right now one of my open tasks is adding Horde/IMP support to our log environment. Doing so I discovered that this is a &quot;not-so-funny&quot;-task.



Problem description

-------------------

Main problems when trying to parse Horde log lines are:

- localized / translated log lines

- log lines completely missing essential information like client ip and username



Examples

--------

The following are unsorted examples to give you some idea what I&#039;m trying to talk about:

- on line 748 of imp/lib/Compose.php: &#039;Failed to add recipient: ...&#039; -&gt; no username, no ip

- on line 195 of imp/lib/IMAP/Cache.php: &#039;[CLOSED] IMAP connection broken...&#039; -&gt; IDEM

- on line 67 of imp/login.php: &#039;1.2.3.4 Ihre Webmail-Session ist abgelaufen...&#039; -&gt; should not be German

- on line 67 of imp/login.php: &#039;1.2.3.4 Ihre Internetadresse hat sich geändert...&#039; -&gt; IDEM, and: if logout occurs because of a changed IP, there should be mentioned &#039;old ip&#039;, &#039;new ip&#039; and &#039;username&#039;



Solution

--------

The reason for string translation in login.php is that the &quot;logout reason&quot; string is going to be passed as an URL parameter for usage as notification and also log string. Logging should not occur here, it should happen where the problem got detected, before issueing the redirect.



I would suggest some &quot;log line format coding standard&quot;, all Horde apps should wherever possible try to follow a common pattern. Some suggestions for such rules:



- Client IP MUST be logged whenever available

- Username MUST be logged whenever available

- Log entries MUST NOT be translated

- English log lines SHOULD NOT be changed between minor releases

- Log line components (ip, user, other values, text message) SHALL always use: your preferred  AVP-syntax (for example: key=val[, key=&quot;val ue&quot;]...)



Horde 4 would be a great chance to introduce such changes, as changing log format in Horde 3.x is probably a not so good idea. Feedback is welcome!



Best regards,

Thomas Gelf



NB: As I&#039;ve been unsure which queue to choose, I&#039;ve chosen the one containing most components - please feel free to move this issue where it fits best in your believes ;-)

</description> 
   <pubDate>Wed, 07 Jan 2009 18:28:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7829#t51583</link> 
  </item> 
   
  <item> 
   <title>(please change ticket version to &quot;HEAD&quot;)</title> 
   <description>(please change ticket version to &quot;HEAD&quot;)</description> 
   <pubDate>Wed, 07 Jan 2009 18:40:43 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7829#t51584</link> 
  </item> 
   
  <item> 
   <title>Hmmm... After grepping around through Horde 4 code (GIT repo</title> 
   <description>Hmmm... After grepping around through Horde 4 code (GIT repository) I discovered that some mentioned issues are already going to be addressed there :-)



It&#039;s also great to see that Horde logger is going to look like ZF&#039;s one! Will it be possible to configure multiple observers/listeners/handlers with different filters in Horde&#039;s config files? And to add other handlers at runtime / using hooks?



I also had a quick look at Horde_Log_Handler_Syslog - if interested you could add some improvements from my Zend_Log_Writer_Syslog proposal:

http://framework.zend.com/wiki/display/ZFPROP/Zend_Log_Writer_Syslog+-+Thomas+Gelf

It is able to handle multiple parallel syslog handler instances with different facilities and ident&#039;s and currently to be found in ZF&#039;s Standard Incubator (class skeleton on the proposal&#039;s site could be outdated).



Btw: PHP docs are not correct (I gave a quick look at PHP&#039;s source code), syslog, openlog and closelog will never fail and return &quot;false&quot;, even if you completely remove your log device.



Cheers,

Thomas

</description> 
   <pubDate>Wed, 07 Jan 2009 19:06:27 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7829#t51587</link> 
  </item> 
   
  <item> 
   <title>One more comment:



IMP::loginLogMessage() is doing a great</title> 
   <description>One more comment:



IMP::loginLogMessage() is doing a great job for most tasks, however it is not handling all events I&#039;m interested in ;-) What I noticed is that when using the _username_hook_frombackend-Hook, IMP::loginLogMessage() is logging the &quot;wrong&quot; username, it is using data from $_SESSION[&#039;imp&#039;][&#039;user&#039;] (Auth::getAuth() is showing the corrected one).



To be more precise, I&#039;m applying String::lower() in my _username_hook_frombackend, and I&#039;m also adding our main domain if no domain has been given. I agree that it would be interesting to also have the &quot;original&quot; username in my logs, but this could be an addition. If a User is logging in as Joe I would like to have



&gt; Login success for joe@mycompany.tld [1.2.3.4]...



or



&gt; Login success for joe@mycompany.tld (Joe) [1.2.3.4]...



but not just



&gt; Login success for Joe [1.2.3.4]...



to be written to my logs.

</description> 
   <pubDate>Wed, 07 Jan 2009 19:32:49 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7829#t51588</link> 
  </item> 
   
  <item> 
   <title>&gt; It&#039;s also great to see that Horde logger is going to look </title> 
   <description>&gt; It&#039;s also great to see that Horde logger is going to look like ZF&#039;s 

&gt; one! Will it be possible to configure multiple 

&gt; observers/listeners/handlers with different filters in Horde&#039;s config 

&gt; files? And to add other handlers at runtime / using hooks?



Sure.



&gt; I also had a quick look at Horde_Log_Handler_Syslog - if interested 

&gt; you could add some improvements from my Zend_Log_Writer_Syslog 

&gt; proposal:

&gt; http://framework.zend.com/wiki/display/ZFPROP/Zend_Log_Writer_Syslog+-+Thomas+Gelf



If you wanted to submit a patch that would be wonderful.</description> 
   <pubDate>Fri, 09 Jan 2009 19:13:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7829#t51640</link> 
  </item> 
   
  <item> 
   <title>Let&#039;s start with feedback on what I already said; in general</title> 
   <description>Let&#039;s start with feedback on what I already said; in general, patches are going to make you much more persuasive than otherwise here.</description> 
   <pubDate>Mon, 12 Jan 2009 01:45:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7829#t51656</link> 
  </item> 
   
  <item> 
   <title>Sorry for my late reply, I&#039;ve been really busy last days as </title> 
   <description>Sorry for my late reply, I&#039;ve been really busy last days as we finished and released our beautiful great new DIMP-based Webmail ;-) I opened a new ticket 7845 with a patch for Horde&#039;s syslog handler some minute ago.



What&#039;s your opinion regarding my &quot;log line format coding standard&quot;-suggestion?



Regards,

Thomas</description> 
   <pubDate>Wed, 14 Jan 2009 12:05:44 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7829#t51707</link> 
  </item> 
   
  <item> 
   <title>&gt; What&#039;s your opinion regarding my &quot;log line format coding 
</title> 
   <description>&gt; What&#039;s your opinion regarding my &quot;log line format coding 

&gt; standard&quot;-suggestion?



I haven&#039;t really had a chance to think about it. Something like that seems reasonable, but my prior statement about patches still applies. :)</description> 
   <pubDate>Wed, 21 Jan 2009 22:33:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7829#t51890</link> 
  </item> 
   
  <item> 
   <title>It will be useful to log even the host name for vhost instal</title> 
   <description>It will be useful to log even the host name for vhost installations.</description> 
   <pubDate>Thu, 05 Feb 2009 14:01:49 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7829#t52300</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
