#logging #filter #uwsgi
#ведение журнала #Фильтр #uwsgi
Вопрос:
Я использую uWSGI и хочу фильтровать журналы (мне не нужно регистрировать запросы на нескольких конечных точках). Я обнаружил, что у uWSGI есть специальная опция, называемая log-filter для этого.
Но мой двоичный файл uwsgi не распознает эту опцию:
$ uwsgi --help | grep log-
--log-format set advanced format for request logging
--log-format-strftime apply strftime to logformat output
--log-syslog log to syslog
--log-socket send logs to the specified socket
--log-encoder add an item in the log encoder chain
--log-req-encoder add an item in the log req encoder chain
--backlog-alarm raise the specified alarm when the socket backlog queue is full
--log-master delegate logging to master process
--log-master-bufsize set the buffer size for the master logger. bigger log messages will be truncated
--log-master-stream create the master logpipe as SOCK_STREAM
--log-master-req-stream create the master requests logpipe as SOCK_STREAM
--log-reopen reopen log after reload
--log-truncate truncate log on startup
--log-maxsize set maximum logfile size
--log-backupname set logfile name after rotation
--log-date prefix logs with date or a strftime string
--log-prefix prefix logs with a string
--log-zero log responses without body
--log-slow log requests slower than the specified number of milliseconds
--log-4xx log requests with a 4xx response
--log-5xx log requests with a 5xx response
--log-big log requestes bigger than the specified size
--log-sendfile log sendfile requests
--log-ioerror log requests with io errors
--log-micros report response time in microseconds instead of milliseconds
--log-x-forwarded-for use the ip from X-Forwarded-For header instead of REMOTE_ADDR
--rsyslog-packet-size set maximum packet size for syslog messages (default 1024) WARNING! using packets > 1024 breaks RFC 3164 (#4.1)
--rsyslog-split-messages split big messages into multiple chunks if they are bigger than allowed packet size (default is false)
--cheaper-busyness-backlog-alert spawn emergency worker(s) if any time listen queue is higher than this value (default 33)
--cheaper-busyness-backlog-multiplier set cheaper multiplier used for emergency workers (default 3)
--cheaper-busyness-backlog-step number of emergency workers to spawn at a time (default 1)
--cheaper-busyness-backlog-nonzero spawn emergency worker(s) if backlog is > 0 for more then N seconds (default 60)
У меня последняя версия uWSGI:
$ uwsgi --version
2.0.19.1
Что я пропустил?
Ответ №1:
для опции —log-filter uwsgi должен быть скомпилирован с поддержкой pcre