Skip to content

run log_by_lua before the access log #254

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

Closed
calind opened this issue Jul 3, 2013 · 3 comments
Closed

run log_by_lua before the access log #254

calind opened this issue Jul 3, 2013 · 3 comments

Comments

@calind
Copy link

calind commented Jul 3, 2013

I think a better behavior of log_by_lua would be to run before access_log so that it can set some variables which can be written afterward by access_log.

For example one can do a json econde of data he wants to be logged and then let access log to write the log. This way you can simply have your data in logs already in json format and you don't need to to a translation from log format to json.

@agentzh
Copy link
Member

agentzh commented Jul 3, 2013

Please try out the following patch for ngx_lua which ensures that log_by_lua is always the first handler in the log phase:

http://openresty.org/download/ngx-lua-log-phase-hack.patch

Thanks!

agentzh added a commit that referenced this issue Aug 27, 2013
…module (for access logging). thanks Calin Don for the suggestion in #254.
@agentzh
Copy link
Member

agentzh commented Aug 27, 2013

I've just committed a modified version of the patch to git master. Please try it out :)

@agentzh
Copy link
Member

agentzh commented Sep 8, 2013

Consider it resolved.

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

2 participants