Ok, those logs were not added by me.
I am not sure why there are so many logs there.
What I did is reduce some useless logs by looking the logs generated by lrmd.
I am sorry I haven't review every log there. I will do so when I have time.
And you can fix the logs if you are interested.
Thanks for you comments.
Lars Marowsky-Bree wrote:
On 2006-08-11T16:48:55, Huang Zhen <[EMAIL PROTECTED]> wrote:
if (rc != EXECRA_OK || debug_level > 0) {
^^^^^^^^^^^^^^
Actually, all these logs are protected to only occur while debugging
already. Could you PLEASE settle on using either that abstraction _or_
lrmd_debug() calls? This is mightily confusing to review :-(
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.
Well, the first error leg handles child processes being killed by a
signal. That very clearly implies that something is 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.
Yes, instead of fixing them to be logged when appropriate (ie, when
something failed), you no longer log them at all. I don't think that is
the appropriate fix to attain useful logging.
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.
A cleanly stopped resource (monitor == 7) probably shouldn't log the
output, but all other non-zero exit codes ought to.
And, given that RAs shouldn't log to stdout/stderr _at all_, any data
present on stderr definitely should _always_ be logged.
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/