In our example, the severity level error also enables crit, alert, and emerg levels to be logged. Messages are logged at the specified level and all more severe levels. Possible values in order of increasing severity are: debug, info, notice, warn, error (default), crit, alert, and emerg. The severity= parameter sets the severity level of syslog messages for access log. The tag= parameter applies a custom tag to syslog messages ( nginx in our example). Other possible values are: auth, authpriv, daemon, cron, ftp, lpr, kern, mail, news, syslog, user, uucp, local0. The facility= parameter specifies the type of program that is logging the message. In the example, NGINX error log messages are written to a UNIX domain socket at the debug logging level, and the access log is written to a syslog server with an IPv6 address and port 1234. Process the log file to determine the spread of data:Įrror_log syslog:server=unix:/var/log/nginx.sock debug access_log syslog:server=:1234,facility=local7,tag=nginx,severity=info Http access_log /tmp/sslparams.log sslparams if= $logme #. The format is then applied to a virtual server that enables compression. The following examples define the log format that extends the predefined combined format with the value indicating the ratio of gzip compression of the response. The log format is defined using variables. To override the default setting, use the log_format directive to change the format of logged messages, as well as the access_log directive to specify the location of the log and its format. By default, the access log is located at logs/access.log, and the information is written to the log in the predefined combined format. NGINX writes information about client requests in the access log right after the request is processed. Note: The ability to specify multiple error_log directives on the same configuration level was added in NGINX Open Source version 1.5.2. However, if several error_log directives are specified on the same level, the message are written to all specified logs. In case of an error, the message is written to only one error log, the one closest to the level where the error has occurred. The error_log directive can be also specified at the http, stream, server and location levels and overrides the setting inherited from the higher levels. Settings in the main context are always inherited by other configuration levels ( http, server, location). To override it, place the error_log directive in the main (top-level) configuration context. The default setting of the error log works globally. In this case, messages of warn, error crit, alert, and emerg levels are logged.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |