You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Chris Darroch (JIRA)" <ji...@apache.org> on 2009/02/05 19:51:59 UTC

[jira] Commented: (ZOOKEEPER-216) Improve logging in C client

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670859#action_12670859 ] 

Chris Darroch commented on ZOOKEEPER-216:
-----------------------------------------

A few specific ideas and areas of concern.

The threads spawned by a single connection handle may write to the log file at the same time.  Personally, this doesn't concern me overmuch; I'd prefer not to have the logging subsystem doing a lot of mutex locking just to ensure the occasional log entries don't collide.

More seriously, the logLevel and logStream variables in zk_log.c are global resources.  That means if a program opens several ZooKeeper connections, they all share the file descriptor, and so all connection handles are affected if any part of the program changes the log file descriptor.  There may also be a small possibility of collision that if one thread changes the log file descriptor while another is reading it (although it's just a pointer, so it depends on whether the pointer is updated atomically).

At any rate, it would be excellent to have per-connection-handle logging attributes (level and stream).

> Improve logging in C client
> ---------------------------
>
>                 Key: ZOOKEEPER-216
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-216
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client
>    Affects Versions: 3.0.0
>            Reporter: Patrick Hunt
>             Fix For: 3.2.0
>
>
> While debugging a client issue we saw multiple areas for improvement in C logging.
> It might be a good idea to also move to log4c. Anyone have experience with this? multithread an issue?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.