mirror of
https://github.com/arut/nginx-rtmp-module.git
synced 2025-08-06 15:00:18 +08:00
add $msec suppoprt for access_log
This commit is contained in:
@ -189,6 +189,26 @@ ngx_rtmp_log_var_remote_addr_getdata(ngx_rtmp_session_t *s, u_char *buf,
|
||||
}
|
||||
|
||||
|
||||
static size_t
|
||||
ngx_rtmp_log_var_msec_getlen(ngx_rtmp_session_t *s,
|
||||
ngx_rtmp_log_op_t *op)
|
||||
{
|
||||
return NGX_TIME_T_LEN + 4;
|
||||
}
|
||||
|
||||
|
||||
static u_char *
|
||||
ngx_rtmp_log_var_msec_getdata(ngx_rtmp_session_t *s, u_char *buf,
|
||||
ngx_rtmp_log_op_t *op)
|
||||
{
|
||||
ngx_time_t *tp;
|
||||
|
||||
tp = ngx_timeofday();
|
||||
|
||||
return ngx_sprintf(buf, "%T.%03M", tp->sec, tp->msec);
|
||||
}
|
||||
|
||||
|
||||
static size_t
|
||||
ngx_rtmp_log_var_session_string_getlen(ngx_rtmp_session_t *s,
|
||||
ngx_rtmp_log_op_t *op)
|
||||
@ -431,6 +451,11 @@ static ngx_rtmp_log_var_t ngx_rtmp_log_vars[] = {
|
||||
ngx_rtmp_log_var_time_local_getdata,
|
||||
0 },
|
||||
|
||||
{ ngx_string("msec"),
|
||||
ngx_rtmp_log_var_msec_getlen,
|
||||
ngx_rtmp_log_var_msec_getdata,
|
||||
0 },
|
||||
|
||||
{ ngx_string("session_time"),
|
||||
ngx_rtmp_log_var_session_time_getlen,
|
||||
ngx_rtmp_log_var_session_time_getdata,
|
||||
|
Reference in New Issue
Block a user