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

Improve access logging #712

Closed
3 of 4 tasks
mikz opened this issue May 15, 2018 · 5 comments
Closed
3 of 4 tasks

Improve access logging #712

mikz opened this issue May 15, 2018 · 5 comments

Comments

@mikz
Copy link
Contributor

mikz commented May 15, 2018

Use Cases

Details

access_log directive offers if to enable/disable logging by setting a variable to 0/1 - this can be used to enable/disable logging by a policy.

It is possible the path parameter of the access_log directive can be a variable too and can be controlled from within a policy. Then we should consider using open_log_file_cache to files opened.

Syslog can be either achieved by setting syslog: path to the access_log directive, or we have to reuse https://github.com/nmasse-itix/apicast-logger to offer syslog from a policy.

Custom formats can be defined by log_format directive pointing just to a variable that is later populated by a policy.

@mikz mikz added this to the 3.3 milestone May 15, 2018
@3scale 3scale deleted a comment from mayorova May 15, 2018
@mikz
Copy link
Contributor Author

mikz commented Aug 27, 2018

Conclusion from my research:

  1. syslog has to be set when the gateway starts and is global for all services. So it either logs to a file (stdout) or syslog.

  2. Logging format can be customized, but it is pretty unpredictable because of nginx escaping the result. This can be turned off in nginx 1.13.10 but we have 1.13.6. We would have to wait for next OpenResty release to properly support this.

  3. We can enable/disable logging per service easily.

@davidor davidor self-assigned this Aug 27, 2018
@davidor davidor mentioned this issue Aug 27, 2018
mikz added a commit that referenced this issue Aug 28, 2018
Part of #712

Log path starting with `syslog:` or `memory:` is not relative path, but
has to be passed to nginx unchanged.
mikz added a commit that referenced this issue Aug 28, 2018
Part of #712
Fixes issue introduced by #857

Log path starting with `syslog:` or `memory:` is not relative path, but
has to be passed to nginx unchanged.
mikz added a commit that referenced this issue Aug 28, 2018
Part of #712
Fixes issue introduced by #857

Log path starting with `syslog:` or `memory:` is not relative path, but
has to be passed to nginx unchanged.
@davidor
Copy link
Contributor

davidor commented Aug 28, 2018

So, regarding the format, we decided to wait for the next release of OpenResty (see @mikz comment above). Enabling/Disabling the service can be done with the policy introduced in #856 , and APIcast can be configured to log to syslog using an ENV.

I think there's nothing else we need to do for 2.3, so I'll remove this issue from the milestone.
/cc @andreumasferrer

@davidor davidor removed this from the 3.3 milestone Aug 28, 2018
@andreumasferrer
Copy link

ACK. Will update THREESCALE-1148 accordingly.

@davidor davidor removed their assignment Sep 6, 2018
@metaversed
Copy link

hi @mikz Is it possible to expect this feature as a policy?

@davidor
Copy link
Contributor

davidor commented Aug 5, 2019

Done in #1089

@davidor davidor closed this as completed Aug 5, 2019
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

4 participants