Skip to content

Unable to use this plugin for log into local server log files #57

@sandbh

Description

@sandbh

Trying to use this plugin for log into local server log files
like /var/log/messages' or in some custom log file apart from nginx access or error log ie /var/log/testing.log etc.
But unable to do this.
getting following errors while trying
failed to flush log message: try to send log messages to the log server failed after 3 retries: try to connect to the log server failed after 3 retries: connection refused
failed to flush log message: try to send log messages to the log server failed after 3 retries: try to connect to the log server failed after 3 retries: permission denied
Am I configuring something wrong......

local ok, err = logger.init{
host = 'localhost',
path='/var/log/messages',
}
if not ok then
ngx.log(ngx.ERR, "failed to initialize the logger: ",
err)
return
end
end
-- construct the custom access log message in
-- the Lua variable "msg"

            local bytes, err = logger.log(msg)
            if err then
                ngx.log(ngx.ERR, ".failed to log message: ", err)
                return
            end
            local bytes, err = logger.flush()
            if err then
                 **ngx.log(ngx.ERR, "failed to flush  log message: ", err)**
                return
            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