Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sandbh opened this issue Nov 8, 2021 · 0 comments
Open

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

sandbh opened this issue Nov 8, 2021 · 0 comments

Comments

@sandbh
Copy link

sandbh commented Nov 8, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant