Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

flag indicating whether any logs were discarded when capturing error_log using the 'lua_capture_error_log' directive #510

Copy link
Copy link
@hachi029

Description

@hachi029
Issue body actions

The error_log module just throw away the oldest ones silently if the user reads the buffered error log not fast enough or the buffer configured by lua_capture_error_log is too small, resulting in unnoticed logs lost.

There should be an api to read or return a flag indicating whether any logs were discarded.

For example:

local errlog = require "ngx.errlog"

local res, err, discarded = errlog.get_logs(30)

if err then 
     ...
end

if discarded then 
    -- change the filter_level (for example, from ngx.INFO to ngx.NOTICE) or do something else
    local log_level = errlog.get_sys_filter_level()
    errlog.set_filter_level(log_level-1)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.