sysguard_log_level

The sysguard_log_level directive sets the logging level for events related to the sysguard module in NGINX.

Syntaxsysguard_log_level level;
Defaulterror
Contexthttp, server, location
Arguments1

Description

The sysguard_log_level directive allows administrators to specify the verbosity of logging for the NGINX sysguard module. It can accept a single argument that corresponds to one of the predefined log levels: info, notice, warn, and error. This flexibility enables users to tailor the log output according to the operational needs, whether to capture detailed information for troubleshooting or to limit logs to warnings and errors only.

When the sysguard module is enabled, events such as system load, memory usage, or response time metrics can generate different levels of log messages depending on the configured sysguard_log_level. By adjusting this directive, users can control the amount of logging information that can provide insights into the performance and health of the NGINX server. Using a higher verbosity level like info can help in diagnosing issues during high load scenarios, while a lower level like error might be preferable for production environments where log size and performance concerns are significant.

The directive is applicable at the http, server, and location contexts, allowing for granular control of logging behavior based on specific application needs or traffic patterns. This ensures that log management is efficient and relevant based on the server’s configuration and load.

Config Example

server {
    sysguard on;
    sysguard_log_level info;
    sysguard_load load=15 action=/loadlimit;
}

Ensure the log level is appropriate for your production environment to avoid excessive logging.

Changing the log level dynamically can lead to inconsistency in log files if not managed across different contexts.

Using too verbose a log level (e.g., info) in high-traffic environments may lead to performance degradation due to increased I/O operations.

← Back to all directives