Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-2037

Improve logging efficiency by not calling zabbix_log() if DebugLevel is not LOG_LEVEL_DEBUG

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 2.2.0
    • Agent (G), Proxy (P), Server (S)
    • None

      Many functions use debug logging, for example

      zabbix_log(LOG_LEVEL_DEBUG, "In %s() sensor:'%s@[%s]:%d'", __function_name,
      sensor_id_to_str(id_str, sizeof(id_str), id, id_type, id_sz), h->ip, h->port);
      ...
      zabbix_log(LOG_LEVEL_DEBUG, "End of %s():%p", __function_name, s);

      On busy production systems DebugLevel is normally not set to LOG_LEVEL_DEBUG but still all arguments to zabbix_log() are evaluated and discarded - a waste of CPU time. Let's avoid unnecessary calling zabbix_log() in this case.

            Unassigned Unassigned
            andris Andris Mednis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: