[#9322] Syslog is appending the conf['log']['ident'] value to the message log
Summary Syslog is appending the conf['log']['ident'] value to the message log
Queue Horde Base
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners jan@horde.org
Requester goncalo.queiros@portugalmail.net
Created 2010-10-20 (3231 days ago)
Due
Updated 2011-08-08 (2939 days ago)
Assigned 2010-11-25 (3195 days ago)
Resolved 2011-08-08 (2939 days ago)
Milestone
Patch No

Comments
goncalo.queiros@portugalmail.net 2010-10-20 10:47:58
I don't know if this is the intended behaviour, but now all Syslog 
messages will be in the form of:

"identity: identity [app] message"

The identity is repeated, which seems excessive.
The problem i think, is on the Horde_Core_Log_Logger::log function, 
that merges the original message with the conf['log']['ident'] and 
then passes this new string as the message to syslog class (or 
whatever log system Horde is using).
This works fine with files because they don't get the identity repeated...

goncalo.queiros@portugalmail.net 2010-11-10 15:21:25
Tried to stick to what was said on Dev.
Make every handler handle the ident conf on their own
Syslog handler now has a new conf (syslog_ident), that is appended to 
the begining of every logged message.

I believe the patch is not 100% correct, due to my lack of knowledge 
of other log handlers (like db and firebug).

Jan Schneider <jan@horde.org> 2010-11-25 17:53:57
That doesn't look quite right.
For one, don't use the global configuration in the library code, i.e. 
in Horde_Log_Handler_Syslog.
Beside that, I thought the idea was to use the existing ident 
configuration as the the handlers sees fit. That means that the syslog 
handler should not introduce a new ident configuration, but use the 
existing one, right?

goncalo.queiros@portugalmail.net 2010-11-28 20:13:40
> Beside that, I thought the idea was to use the existing ident 
> configuration as the the handlers sees fit. That means that the 
> syslog handler should not introduce a new ident configuration, but 
> use the existing one, right?

I proposed that on dev, but then i think other members preferred the 
"new conf" way..I don't mind doing any way, just need to know ;)

Chuck Hagenbuch <chuck@horde.org> 2011-03-19 02:16:16
I agree with Jan. Can you update the patch?

Jan Schneider <jan@horde.org> 2011-03-31 23:44:25
Ping?

goncalo.queiros@portugalmail.net 2011-04-01 00:07:18
Hey Chuck sorry for the delay, missed your email somehow.
Probably don't have time tomorrow to look at it, but Monday will try 
to have the patch ready

goncalo.queiros@portugalmail.net 2011-04-08 10:49:41
Sorry for the delay.

Now the ident append is done in Horde_Log_Handler_Base::appendIdent. 
If a handler want's to change the behavior, it just needs to overwrite 
this method (just like i did with syslog handler)

Jan Schneider <jan@horde.org> 2011-04-18 11:33:56
This is not a valid solution either, because framework code accesses 
Horde configuration.

Jan Schneider <jan@horde.org> 2011-05-18 16:18:01
Ping?

goncalo.queiros@portugalmail.net 2011-05-23 11:03:49
Hi there.

I used the GLOBALS['conf'], because it was already used by the 
framework, and i also didn't saw anything wrong with it, since making 
a grep for 'GLOBALS['conf'] on the framework returns a lot of results.

Can you give me a suggestion of how are you solving this problem?
Thanks

Jan Schneider <jan@horde.org> 2011-05-23 11:51:31
The only place where you could see $conf access in the framework is in 
the Core package. You need to pass any configuration settings that you 
need into the class constructors.

goncalo.queiros@portugalmail.net 2011-05-23 15:53:26
Is this the intended fix?

Jan Schneider <jan@horde.org> 2011-06-08 13:29:25
Looks much better now. I can even be improved though, if you simply 
call setOption() (and catch exceptions for BC reasons) where the 
handler is instantiated. This way you don't need to change the 
constructor signatures of the handlers. You only need to add the 
'ident' option to all handlers' $_options array.

Jan Schneider <jan@horde.org> 2011-07-30 12:12:29
Ping?

goncalo.queiros@portugalmail.net 2011-08-02 10:06:52
> Ping?
Sorry..here it goes

Git Commit <commits@lists.horde.org> 2011-08-08 17:01:55
Changes have been made in Git for this ticket:

Make every log handler, handle the message ident on their own
Request: #9322
Signed-off-by: Jan Schneider <jan@horde.org>

  6 files changed, 28 insertions(+), 5 deletions(-)
http://git.horde.org/horde-git/-/commit/687f7cc6314e9f3250629032e389ce39e47e7453

Git Commit <commits@lists.horde.org> 2011-08-08 17:01:59
Changes have been made in Git for this ticket:

We still want to use the configured handler, even if setting the ident 
fails (Request #9322).

  2 files changed, 8 insertions(+), 2 deletions(-)
http://git.horde.org/horde-git/-/commit/94861a4107ac7e07f234aaed3e787f80b4be8c50

Git Commit <commits@lists.horde.org> 2011-08-08 17:02:02
Changes have been made in Git for this ticket:

Set ident option in base driver (Request #9322).

  2 files changed, 3 insertions(+), 10 deletions(-)
http://git.horde.org/horde-git/-/commit/4e9e6b14fbe58b08e4f43b1603f8884abd85685d

Git Commit <commits@lists.horde.org> 2011-08-08 17:02:06
Changes have been made in Git for this ticket:

Changelog (Request #9322).

  2 files changed, 2 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/486b9e2d96278419aa48e6f469a195dd983bfd0e