Skip to content

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

@hachi029

Description

@hachi029

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 filter_level (for example, from ngx.INFO to ngx.NOTICE)
    errlog.set_filter_level(log_level)
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