FMS的log日志设置



Server.xml (全局设置)

<!-- Overall logging configuration. This section contains only information that is -->
<!-- that controls the overall logging behaviour. Specific logging configuration is -->
<!-- 全局log日志配置,这节只包含控制全局log日志收集情况,具体的配置文件包含在 -->
<!-- Logger.xml这个文件中 -->
<!-- located in Logger.xml. -->
<Logging>
<!-- The time field in a log file can be either in utc (gmt) or local (default).-->
<!-- 在时间方面日志文件是以GMT(格林尼治)时间或本地时间(默认是本地时间) -->
<Time>local</Time>
<Access>
<!-- Whether access logging is enabled. -->
<!-- 服务器访问日志是否启用设置 -->
<Enable>true</Enable>

<!-- The logging scope determines whether a log file is written out for -->
<!-- each vhost or just one for the entire server. It may be either server -->
<!-- or vhost. -->
<!-- 日志范围的确定,是每个虚拟主机分开记录还是只对整个服务器记录,选项可以 -->
<!-- server或者vhost -->
<Scope>server</Scope>
</Access>
<Diagnostic>
<!-- Whether diagnostic logging is enabled. -->
<!-- 诊断日志是否启用设置 -->
<Enable>true</Enable>
</Diagnostic>
<Application>
<!-- Whether application logging is enabled. -->
<!-- 应用程序日志是否启用设置 -->
<Enable>true</Enable>
</Application>
</Logging>

======================================================================================

Logger.xml (日志文件具体设置)

<Logger>
<Access>
<!-- This section configures the server to send log msgs to a -->
<!-- remote logging server. To enable this feature, set the -->
<!-- "enable" attribute to true. You can choose the type of -->
<!-- connection to use by specifying the "type" attribute which -->
<!-- can be set to either "udp" or "tcp". Default is udp. -->
<!-- 本节配置服务器发送日志信息到一个远程日志服务器,要实现这个这-->
<!-- 个功能,可以设置"enable"的属性为"true".你可以选择使用何种连 -->
<!-- 接方式,可以设定为"udp"或者"tcp",默认是udp -->
<LogServer enable="false" type="udp">
<!-- Specify the IP and port of the server to log to. -->
<!-- 明确日志服务器的IP和端口 -->
<!-- For example, -->
<!-- <HostPort>xxx.xxx.xxx.xxx:1234</HostPort> -->
<HostPort></HostPort>

<!-- This is an identifier used to identify the server that -->
<!-- the log came from. By default, this is the IP address -->
<!-- of this server. -->
<!-- 这是用来设置标识log日志中服务器的来源,默认是这个服务器 -->
<!-- IP地址. -->
<ServerID></ServerID>

<!-- This specifies how many lines to log before including -->
<!-- the fields header again. -->
<DisplayFieldsHeader>100</DisplayFieldsHeader>
</LogServer>

<!-- Directory in which log files will be placed, by default they are -->
<!-- placed in logs/ in the server installation directory. -->
<!-- 日志文件得存放路径,默认日志文件会存放在服务器安装得根目录下的logs目录 -->
<Directory>${LOGGER.LOGDIR}</Directory>

<!-- Access log file name, everything inside the square brackets will be -->
<!-- substituted. -->
<!-- Y represents Year, only YYYY is allowed -->
<!-- M represents Month, only M or MM are allowed -->
<!-- D represents Day, only D or DD are allowed -->
<!-- N represents Version, there is no limit on number of N -->
<!-- The number of each letter represents number of digits, for example -->
<!-- April in M is 4 and in MM is 04 -->
<!-- 访问日志名称规则,方括号内可以用以下替代 -->
<!-- Y 代表连,只有 YYYY 才被允许 -->
<!-- M 代表月,只有 M 或者 MM 才被允许 -->
<!-- D 代表日,只有 D 或者 DD 才被允许 -->
<!-- N 代表版本号,这里没有针对N数量的限制 -->
<!-- 每个字母的数量代表一些数字,举例 -->
<!-- 4月 用 M 表示就是4 用MM表示就是04 -->
<FileName>access.[NN].log</FileName>

<!-- The time field in a log file can be either in utc or local time. The -->
<!-- setting here can be used to override the server-wide configuration, -->
<!-- see <Logging> in Server.xml. -->
<!-- 在日志里的时间字段,可以设置为UTC或者当地时间,这个设置可以覆盖服务器配置-->
<!-- 中logging段中的全局设置 -->
<Time></Time>

<Rotation>
<!-- Maximum file size in kilobytes (1024 bytes) -->
<!-- 日志轮循设置,设置每个轮循日志的最大文件大小KB -->
<MaxSize>10240</MaxSize>

<!-- Rotation Time, there are 2 types -->
<!-- If type="daily", rotation only occurs every 24 hours, and the format -->
<!-- is hh:mm, for example 00:00 will rotates every midnight -->
<!-- If type="duration", rotation occurs when the duration of the log -->
<!-- exceed a certain length, duration takes a number in minutes -->
<!-- 轮循间隔时间,这里有2种方式 -->
<!-- 如果方式为"daily",就每隔24小时轮循一次,后面的时间参数是hh:mm,比如-->
<!-- 00:00 代表每天0点轮循 -->
<!-- 如果方式为"duration",就是当超过一定时间就轮循 -->
<Schedule type="daily">00:00</Schedule>

<!-- Max number of log files to keep, files will be named access.01.log, -->
<!-- access.02.log, access.03.log etc. -->
<!-- 如果日志命名为access.01.log,access.03.log,access.03.log时,日志文件的 -->
<!-- 最大保存数量 -->
<History>5</History>
</Rotation>

<!-- The following describes which events to be logged. The various events -->
<!-- are as follows, -->
<!-- Event Name Category -->
<!-- ========== ======== -->
<!-- 1. connect-pending session -->
<!-- 2. connect session -->
<!-- 3. disconnect session -->
<!-- 4. publish stream -->
<!-- 5. unpublish stream -->
<!-- 6. play stream -->
<!-- 7. pause stream -->
<!-- 8. unpause stream -->
<!-- 9. seek stream -->
<!-- 10. stop stream -->
<!-- 11. record stream -->
<!-- 12. recordstop stream -->
<!-- 13. server-start server -->
<!-- 14. server-stop server -->
<!-- 15. vhost-start vhost -->
<!-- 16. vhost-stop vhost -->
<!-- 17. app-start application -->
<!-- 18. app-stop application -->
<!-- The desired events are specified as a semi-colon separated list. -->
<!-- Specifying * will log all events. -->
<!-- 以下事件行为将被记录到日志中,各项时间行为包括 -->
<!-- 略 -->
<!-- 如果指定为 * 则记录所有的事件行为 -->
<Events>connect;disconnect;play;pause;unpause;stop</Events>


<!-- The following describes what information gets logged for each event. -->
<!-- Not all fields make sense for all events in which case they will be -->
<!-- empty in the log file. The possible fields are, -->
<!-- 1. x-event Type of event -->
<!-- 2. x-category Event category -->
<!-- 3. date Date at which the event occurred -->
<!-- 4. time Time at which the event occurred -->
<!-- 5. tz Time zone information -->
<!-- 6. x-ctx event dependant context information -->
<!-- 7. x-pid server process id -->
<!-- 8. x-cpu-load cpu load -->
<!-- 9. x-mem-load memory load (as reported in getServerStats) -->
<!-- 10. x-adaptor adaptor name -->
<!-- 11. x-vhost vhost name -->
<!-- 12. x-app application name -->
<!-- 13. x-appinst application instance name -->
<!-- 14. c-ip client ip address -->
<!-- 15. c-proto connection protocol - rtmp or rtmpt -->
<!-- 16. s-uri uri of the fms application -->
<!-- 17. c-referrer uri of the referrer -->
<!-- 18. c-user-agent user agent -->
<!-- 19. c-client-id client id -->
<!-- 20. cs-bytes bytes transferred from client to server -->
<!-- 21. sc-bytes bytes transferred from server to client -->
<!-- 22. x-sname stream name -->
<!-- 23. x-file-size stream size in bytes -->
<!-- 24. x-file-length stream length in seconds -->
<!-- 25. x-spos stream position -->
<!-- 26. cs-stream-bytes stream bytes transferred from client to server -->
<!-- 27. sc-stream-bytes stream bytes transferred from server to client -->
<!-- 28. s-ip ip address[es] of the server -->
<!-- 29. x-duration duration of an event/session -->
<!-- 30. x-status status code -->
<!-- 31. cs-uri-stem stem of s-uri -->
<!-- 32. cs-uri-query query portion of s-uri -->
<!-- 33. x-sname-query query portion of stream uri -->
<!-- 34. x-file-name Full file path of recorded stream -->
<!-- 35. x-file-ext stream type (flv or mp3) -->
<!-- 36. x-suri-query Same as x-sname-query -->
<!-- 37. x-suri-stem cs-uri-stem + x-sname + x-file-ext -->
<!-- 38. x-suri x-suri-stem + x-suri-query -->
<!-- 39. x-sc-qos-bytes bytes transferred from server to client for quality of service -->
<!-- The field specification is a semi-colon separated list of one or more -->
<!-- and the special key word * indicates that all fields are to be logged. -->
<!-- When customizing the fields to be logged, it is strongly recommended -->
<!-- to always at least log the type, category, date and time fields. -->
<!-- 下列哪些信息将被记录到每个事件行为中,不是所有的信息都可能传送到日志中 -->
<!-- 所有可能有部分是空白的,在日志中. -->
<!-- 如果指定为 * 则记录所有的事件行为 -->
<Fields>x-category;x-event;date;time;x-pid;c-ip;cs-bytes;sc-bytes;x-sname;sc-stream-bytes;x-file-size;x-file-length</Fields>

<!-- Delimiter is used to separate between fields -->
<!-- Recommended: tab or ' '. If no delimiter is specified, default is tab -->
<!-- Not Recommended: '#', because it is used as comment tag in W3C format -->
<!-- Disallowed: ''', '"', '.', ':', '-', '\' and all alpha-numeric -->
<!-- (a-z, A-Z, 0-9). Character ':' and '-' are not allowed because ':' is -->
<!-- used in the time field and '-' is used in the date field and fields -->
<!-- with empty value. -->
<Delimiter></Delimiter>

<!-- This is an optional flag to control if the fields need to be quoted -->
<!-- when space or delimiter are found in the fields. It can be set to -->
<!-- enable or disable. By default, it is set to disable -->
<!-- 这个选项是控制时候需要启用引用,当在log日志中显示的信息字段中发现空格键 -->
<!-- 可以设置为enable或者disable 默认是disable -->
<QuoteFields>disable</QuoteFields>

<!-- This is an optional flag to control if the fields need to be escaped -->
<!-- when unsafe characters are found in the fields. It can be set to -->
<!-- enable or disable. By default, it is set to enable -->
<!-- Based on rfc1738, unsafe characters are space, <, >, ", #, %, {, }, |, -->
<!-- ^, ~, [, ], ` -->
<EscapeFields>enable</EscapeFields>

</Access>
<Diagnostic>
<!-- Directory in which log files will be placed, by default they are -->
<!-- placed in logs/ in the server installation directory. -->
<!-- 诊断日志文件得存放路径,默认日志文件会存放在服务器安装得根目录下的logs -->
<!-- 目录 -->
<Directory>${LOGGER.LOGDIR}</Directory>

<!-- The time field in a log file can be either in utc or local time. The -->
<!-- setting here can be used to override the server-wide configuration, -->
<!-- see <Logging> in Server.xml. -->
<!-- 在日志里的时间字段,可以设置为UTC或者当地时间,这个设置可以覆盖服务器配置-->
<!-- 中logging段中的全局设置 -->
<Time></Time>

<Rotation>
<!-- Maximum file size in kilobytes (1024 bytes) -->
<!-- 日志轮循设置,设置每个轮循日志的最大文件大小KB -->
<MaxSize>10240</MaxSize>

<!-- Rotation Time, there are 2 types -->
<!-- If type="daily", rotation only occurs every 24 hours, and the format -->
<!-- is hh:mm, for example 00:00 will rotates every midnight -->
<!-- If type="duration", rotation occurs when the duration of the log -->
<!-- exceed a certain length, duration takes a number in minutes -->
<!-- 轮循间隔时间,这里有2种方式 -->
<!-- 如果方式为"daily",就每隔24小时轮循一次,后面的时间参数是hh:mm,比如 -->
<!-- 00:00 代表每天0点轮循 -->
<!-- 如果方式为"duration",就是当超过一定时间就轮循 -->
<Schedule type="daily">00:00</Schedule>

<!-- Max number of log files to keep, files will be named admin.01.log, -->
<!-- admin.02.log, admin.03.log etc. -->
<!-- 如果日志命名为access.01.log,access.03.log,access.03.log时,日志文件的 -->
<!-- 最大保存数量 -->
<History>5</History>
</Rotation>
</Diagnostic>
<Application>
<!-- Directory in which log files will be placed, by default they are -->
<!-- placed in logs/ in the server installation directory. -->
<!-- 应用程序日志文件得存放路径,默认日志文件会存放在服务器安装得根目录下的-->
<!-- logs目录下 -->
<Directory>${LOGGER.LOGDIR}</Directory>

<!-- The time field in a log file can be either in utc or local time. The -->
<!-- setting here can be used to override the server-wide configuration, -->
<!-- see <Logging> in Server.xml. -->
<!-- 在日志里的时间字段,可以设置为UTC或者当地时间,这个设置可以覆盖服务器配置-->
<!-- 中logging段中的全局设置 -->
<Time></Time>

<Rotation>
<!-- Maximum file size in kilobytes (1024 bytes) -->
<!-- 日志轮循设置,设置每个轮循日志的最大文件大小KB -->
<MaxSize>10240</MaxSize>

<!-- Rotation Time, there are 2 types -->
<!-- If type="daily", rotation only occurs every 24 hours, and the format -->
<!-- is hh:mm, for example 00:00 will rotates every midnight -->
<!-- If type="duration", rotation occurs when the duration of the log -->
<!-- exceed a certain length, duration takes a number in minutes -->
<!-- 轮循间隔时间,这里有2种方式 -->
<!-- 如果方式为"daily",就每隔24小时轮循一次,后面的时间参数是hh:mm,比如 -->
<!-- 00:00 代表每天0点轮循 -->
<!-- 如果方式为"duration",就是当超过一定时间就轮循 -->
<Schedule type="daily">00:00</Schedule>

<!-- Max number of log files to keep, files will be named -->
<!-- application.01.log, application.02.log etc. -->
<!-- 如果日志命名为access.01.log,access.03.log,access.03.log时,日志文件的 -->
<!-- 最大保存数量 -->
<History>5</History>
</Rotation>
</Application>
</Logger>
posted @ 2008-02-18 01:28  玉米疯收  阅读(2645)  评论(1编辑  收藏  举报