Configuring logging

Flash Media Server logging is configured through the Server.xml and Logger.xml configuration files. Server.xml contains a Logging section that controls the overall logging behavior. This section includes an Enable tag that determines whether logging takes place, and a Scope tag that determines whether Flash Media Server writes separate log files for each virtual host or one file for the entire server.

The following is an excerpt of the Logging section of the Server.xml file:

<Root>
    <Server>
        <Logging>
        <!-- Overall logging configuration. This section contains only -->
        <!-- information that controls the overall logging behavior. -->
        <!-- Specific logging configuration is located in Logger.xml. -->
            <!-- The time field was added after the Flash Comm Server 1.5.2 -->
            <!-- release. The server can log file in utc (gmt) or local time. -->
            <!-- The default time is local time. -->
            <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. -->
                <Scope>server</Scope>
            </Access>
            <Diagnostic>
                <!-- Whether diagnostic logging is enabled. -->
                <Enable>true</Enable>
            </Diagnostic>
            <Application>
                <!-- Whether application logging is enabled. -->
                <Enable>false</Enable>
            </Application>
        </Logging>
    </Server>
<Root>

Logger.xml files may be provided at the configuration root folder right next to Server.xml and optionally for each vhost right next to VHost.xml file. The root Logger.xml file determines the logger configuration when the logging scope is server-wide. Optionally a specific vhost Logger.xml controls the logging behavior for a given vhost. The virtual host-specific Logger.xml configuration file is relevant only when the activities for each virtual host are being logged in a separate log file. The location of each log file is determined by the Directory and FileName tags in the Logger.xml file(s).

A sample of the Logger.xml file is included later in this document.

For a more complete listing of all tags, see Logger.xml file.

Logger.xml file example

The Logger.xml file contains the following XML:

<Logger> 
    <Access> 
        <!-- Directory in which log files will be placed. By default -->
        <!-- they are placed in logs/ in the server installation directory. -->
        <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's -->
        <!-- The number of each letter represents number of digits, for -->
        <!-- example, April in M is 4 and in MM is 04 -->
        <FileName>access.[YYYYMMDDNN].log</FileName>

        <!-- The time field in a log file can be either in utc or local -->
        <!-- The setting here can be used to override the server-wide 
        <!-- configuration, See <Logging> in Server.xml. -->
        <!-- <Time></Time> -->

        <Rotation> 
            <!-- Maximum file size in kilobytes (1024 bytes)-->
            <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 rotate -->
            <!-- every midnight -->
            <!-- If type="duration", rotation occurs when the duration of -->
            <!-- the log exceeds a certain length. -->
            <!-- Duration takes a number in minutes. -->
            <Schedule type="daily">00:00</Schedule> 

            <!-- Max number of log files to keep. Files will be named -->
            <!-- access.log.1, access.log.2, access.log.3 etc. -->
            <History>5</History> 
        </Rotation> 

        <!-- The following describes which events that can 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. server-start                 server -->
        <!-- 12. server-stop                  server -->
        <!-- 13. vhost-start                  vhost -->
        <!-- 14. vhost-stop                   vhost -->
        <!-- 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 which 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-dependent 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 client to server-> 
        <!--   27. sc-stream-bytes            Stream bytes transferred server to client    --> 
        <!--            28.     s-ip                                IP address(es) of the server                                                                         -->                        
        <!--            29.     x-duration                                   Duration of an event/session                                                                          -->
        <!--            30.     x-status                                 Status an event                                                                        -->
        <!--            31.     cs-uri-stem                                Stem of an 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 file 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            -->                                    
<!-- The field specification is a semicolon-separated list of one          -->
        <!-- or more field names. The special keyword * 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;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).  The characters ':' and '-' are not allowed    -->
        <!-- because ':' is used in the time field and '-' is used in the    -->
        <!-- date field and in fields with empty value.                      --> 
        <Delimiter>','</Delimiter> 

        <!-- This is an optional flag to control if the fields need to be    -->
        <!-- quoted when space or the delimiter are found in the fields.     -->
        <!-- It can be set to enable or disable.  By default, it is set to   -->
        <!-- 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. --> <Directory>${LOGGER.LOGDIR}</Directory> <Rotation> <!-- Maximum file size in kilobytes (1024 bytes) --> <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 rotate every midnight --> <!-- If type="duration", rotation occurs when the duration of the log --> <!-- exceeds a certain length, duration takes a number in minutes --> <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. --> <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. --> <Directory>${LOGGER.LOGDIR}</Directory> <Rotation> <!-- Maximum file size in kilobytes (1024 bytes) --> <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 --> <Schedule type="daily">00:00</Schedule> <!-- Max number of log files to keep, files will be named --> <!-- application.01.log, application.02.log etc. --> <History>5</History> </Rotation> </Application> </Logger>

NOTE

 

Log file rotation cannot be disabled. To effectively turn off rotation, however, you can choose a large maximum size and a long maximum duration.


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fms/2/docs/00000184.html