error_log

The `error_log` directive configures the logging of error messages for SRT connections in NGINX.

Syntaxerror_log file [level];
Defaultlogs/error.log error
Context
Arguments1+

Description

The error_log directive establishes the location and severity level of the error log for SRT connections in NGINX. It allows administrators to specify a file path where error messages will be written, along with an optional logging level that determines the verbosity of messages reported. The logging levels can range from debug, info, notice, warn, error, crit, alert, to emerg, allowing for a tailored logging experience depending on the operational needs.

When the SRT module is configured, any error messages relating to Secure Reliable Transfer connections will be recorded in the specified log file. This includes errors encountered during the handling of SRT streams, such as connection failures or protocol errors. By adjusting the logging level, administrators can filter out less severe messages or focus only on critical issues that require immediate attention.

It's important to note that if the specified log file does not exist or if NGINX does not have write permissions to the file, the logging will fail, and the system may revert to its default logging behavior. Therefore, proper permissions and paths should be set to ensure the reliability of the logging functionality.

Config Example

srt {
    server {
        listen 4321;
        error_log logs/srt_error.log warn;
        proxy_pass tcp://127.0.0.1:5678;
    }
}

Ensure the log file path is writable by the NGINX process to avoid logging failures.

The specified logging level must be one of the recognized NGINX logging levels; otherwise, it will default to 'error'.

It's possible to create multiple error_log entries at different levels, but they should be used judiciously to avoid cluttering log files.

← Back to all directives