[Pacemaker] Logging options: how to change logpriority only for cib

Andrew Beekhof andrew at beekhof.net
Tue May 27 17:05:10 EDT 2014

On 28 May 2014, at 12:33 am, Bernardo Cabezas Serra <bcabezas at apsl.net> wrote:

> Hello,
> The fast question:
> Is it possible to have different logpriorities for cib than for lrmd or pacemakerd?
> The long explanation:
> After upgrading to pacemaker 1.1.12rc1, and enabling pgsql Master/Slave RA, I have lots of logs that are not informative, and would like to adjust logging a little more.
> We run on corosync stack on top of ubuntu.
> As before, pacemaker logs to corosync default, which in our case syslog with local7 facility.
> But now, we get this line each 5 seconds on corosync syslog:
> pacemakerd[23624]:   notice: crm_add_logfile: Additional logging available in /var/log/pacemaker.log

That message should only pop up when pacemakerd has just been started... someone/thing is calling pacemakerd over and over.

> And /var/log/pacemaker.log is at info level, but cib outputs LOTS of cib messages like these (nearly each second):
> ----
> ay 27 16:13:30 [23320] lohap1        cib:     info: cib_process_request:       Completed cib_query operation for section 'all': OK (rc=0, origin=local/crm_mon/2, version=0.172.32)
> May 27 16:13:30 [23320] lohap1        cib:     info: cib_process_request:       Completed cib_query operation for section nodes: OK (rc=0, origin=local/crm_attribute/2, version=0.172.32)
> May 27 16:13:30 [23320] lohap1        cib:     info: cib_process_request:       Completed cib_query operation for section //cib/status//node_state[@id='3232235522']//transient_attributes//nvpair[@name='pgsql-status']: OK (rc=0, origin=local/crm_attribute/3, version=0.172.32)

I'll make the following change for rc2.  There is really no need for query operations to be logged at info.
With those removed, are the cib logs more acceptable?

diff --git a/cib/callbacks.c b/cib/callbacks.c
index 152fcd0..261dc3a 100644
--- a/cib/callbacks.c
+++ b/cib/callbacks.c
@@ -984,7 +984,10 @@ cib_process_request(xmlNode * request, gboolean force_synchronous, gboolean priv
         rc = cib_process_command(request, &op_reply, &result_diff, privileged);
-        if (global_update) {
+        if (is_update == FALSE) {
+            level = LOG_TRACE;
+        } else if (global_update) {
             switch (rc) {
                 case pcmk_ok:
                     level = LOG_INFO;

> -----
> Seems that pgsql RA updates attributes constantly, and this makes lots of cib info messages (150MB a day).
> I have been able to manage pacemaker to output only to sysslog, with logpriority warning, with this config on /opt/ha/etc/default/pacemaker :
> export PCMK_debugfile=/dev/null
> export PCMK_debug=off
> export PCMK_logfacility=local7
> export PCMK_logpriority=warning
> But with this priority we have no info about lrmd or pacemakerd actions.

The default value for PCMK_logpriority, when sending logs to syslog, is 'notice'... that should contain enough information to be useful without being completely overwhelming.
its only the log file that is logged at level 'info' but you've already disabled that with PCMK_debugfile=/dev/null.

> So ideal situation would be to put these new cib verbose logging on priority warning, but lrmd,pacemakerd,pengine on info.
> ¿can it be done?
> Can these cib info messages be suppressed? (either runtime config or compilation time)
> Thanks  so much,
> Bernardo
> -- 
> *Bernardo Cabezas Serra*
> *Responsable Sistemas*
> Camí Vell de Bunyola 37, esc. A, local 7
> 07009 Polígono de Son Castelló, Palma
> Mail: bcabezas at apsl.net
> Skype: bernat.cabezas
> Tel: 971439771
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20140528/8eb17c61/attachment-0003.sig>

More information about the Pacemaker mailing list