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

Add time_iso8601 access_log field #1638

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions ngx_rtmp_log_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,23 @@ ngx_rtmp_log_var_time_local_getdata(ngx_rtmp_session_t *s, u_char *buf,
}


static size_t
ngx_rtmp_log_var_time_iso8601_getlen(ngx_rtmp_session_t *s,
ngx_rtmp_log_op_t *op)
{
return ngx_cached_http_log_iso8601.len;
}


static u_char *
ngx_rtmp_log_var_time_iso8601_getdata(ngx_rtmp_session_t *s, u_char *buf,
ngx_rtmp_log_op_t *op)
{
return ngx_cpymem(buf, ngx_cached_http_log_iso8601.data,
ngx_cached_http_log_iso8601.len);
}


static size_t
ngx_rtmp_log_var_session_time_getlen(ngx_rtmp_session_t *s,
ngx_rtmp_log_op_t *op)
Expand Down Expand Up @@ -451,6 +468,11 @@ static ngx_rtmp_log_var_t ngx_rtmp_log_vars[] = {
ngx_rtmp_log_var_time_local_getdata,
0 },

{ ngx_string("time_iso8601"),
ngx_rtmp_log_var_time_iso8601_getlen,
ngx_rtmp_log_var_time_iso8601_getdata,
0 },

{ ngx_string("msec"),
ngx_rtmp_log_var_msec_getlen,
ngx_rtmp_log_var_msec_getdata,
Expand Down