Tuesday, January 15, 2013

Access log in nginx-rtmp 0.9

The latest feature implemented in nginx-rtmp is access logging. It looks similar to nginx HTTP access logging. Similar to HTTP case the logger is on by default. If not changed explicitly RTMP access logger shares access log file with nginx HTTP engine.


rtmp {
access_log logs/rtmp_access.log;
server {
...
}
}


Logging can be turned off:

access_log off;


RTMP access logger supports formatting with a number of predefined variables. The complete list of supported variables can be found on directives page in log_format directive description.


log_format new '$remote_addr $bytes_sent';
access_log logs/rtmp_access.log new;


Default format combined is supported as well. Here's the definition of this format:

$remote_addr [$time_local] $command "$app" "$name" "$args" -
$bytes_received $bytes_sent "$pageurl" "$flashver" ($session_readable_time)

1 comment: