Lars Marowsky-Bree wrote:
On 2006-08-10T18:12:00, [email protected] wrote:

Hi,

besides turning down the log messages, why are we getting so many of
these in the first place...? Should the code be calling the functions
that often?
I checked the log generated by lrmd.
The almost of them are like these:
Aug 10 22:22:10 hadev2 lrmd: [15897]: debug: on_msg_get_rsc: the client 
[pid:15900] wants to get the information of the resource [rsc_id: 
ocf_127.0.0.13]
Aug 10 22:22:10 hadev2 lrmd: [15897]: debug: on_msg_get_rsc: no rsc with id 
ocf_127.0.0.13.

I think they are general log which is useless for usual situations.


About some specific log messages:


        if (rc != EXECRA_OK || debug_level > 0) {
                if (signo != 0) {
-                       lrmd_log(rc == EXECRA_OK ? LOG_DEBUG : LOG_WARNING
+                       lrmd_debug(rc == EXECRA_OK ? LOG_DEBUG : LOG_WARNING
                        ,       "Resource Agent (%s): pid [%d] killed by"
                        " signal %d", op_info(op), p->pid, signo);
                }else if (rc == exitcode) {
-                       lrmd_log(rc == EXECRA_OK ? LOG_DEBUG : LOG_INFO
+                       lrmd_debug2(rc == EXECRA_OK ? LOG_DEBUG : LOG_INFO
                        ,       "Resource Agent (%s): pid [%d] exited with"
                        " return code %d", op_info(op), p->pid, rc);
                }else{
-                       lrmd_log(rc == EXECRA_OK ? LOG_DEBUG : LOG_INFO
+                       lrmd_debug2(rc == EXECRA_OK ? LOG_DEBUG : LOG_INFO
                        ,       "Resource Agent (%s): pid [%d] exited with"
                        " return code %d (mapped from %d)"
                        ,       op_info(op), p->pid, rc, exitcode);
                }
                if (rc != EXECRA_OK || debug_level > 1) {
-                       lrmd_log(LOG_INFO, "Resource Agent output: [%s]"
+                       lrmd_debug2(LOG_INFO, "Resource Agent output: [%s]"
                        ,       op->first_line_ra_stdout);
                }
        }


I don't think these are good candidates for debug logging. These are
important to trace the event from the LRM to the CRM (and make sure it
wasn't lost in the middle).
In most case, rc!=EXECRA_OK does not mean something wrong.
Only in the case that the resource is running, the rc would be EXECRA_OK.
So we got a lot of logs for the resource which is stopped.
That's why I downgraded these logs.


Besides, the last one is protected with "debug_level > 1" already, so
lrmd_debug2() doesn't change anything.
It's "||" instead of "&&" in the condition.
So as the same reason above, it would log everytime that monitoring a stopped 
resource.


In particular in error legs, we want logging.


Sincerely,
    Lars Marowsky-Brée



--
Best Regards,
Huang Zhen
Linux-HA, Linux Technology Center, China Systems & Technology Lab
China Development Labs, Beijing Tel: 86-10-82782244 Ext. 2845
Email: [EMAIL PROTECTED]
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to