openresty / openresty/lua-resty-core
Option to disable ngx.log extra arguments client, server, request, host, etc.
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 853
- Forks
- 286
- Avg merge
- 35m
- Merged PRs (30d)
- 1
Description
nginx version: openresty/1.17.8.1rc1
built by gcc 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
built with OpenSSL 1.1.0k 28 May 2019
lua-resty-core: 0.1.18
OS: Linux ea01851460a5 4.19.76-linuxkit #1 SMP Tue May 26 11:42:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Hi All,
The default ngx.log(ngx.ERR, "hello world") is printing all the below information.
2017/07/09 19:36:25 [notice] 25932#0: *1 [lua] content_by_lua(nginx.conf:51):5: hello world, client: 127.0.0.1, server: localhost, request: "GET /log HTTP/1.1", host: "localhost"
https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/errlog.md#raw_log
We would like to disable the extra information provided in the default ngx.log core module and only print the message we want based on some flag
2017/07/09 19:36:25 [notice] 25932#0: *1 [lua] content_by_lua(nginx.conf:51):5: hello world,
All the remaining fields such as client, server, request, host, upstream fields should not be printed based on some flag or some other way.
Background:
We are using Nginx as part of the gateway application to authenticate or authorize the backend applications.
When we using ngx.log(ngx.ERR, "message") it is also printing query params that had the OAuth2.0 Authorization Code details.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ngx.log behavior described in the issue and read the linked lua-resty-core errlog.md documentation, especially raw_log. Determine where the extra client, server, request, and host fields originate and how a flag or alternative logging path could control them. Done means the requested message-only behavior is defined and covered by suitable tests or documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, nginx
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100