Sun Java System Directory Server Enterprise Edition 6.0 Administration Guide

ProcedureTo Configure Periodic Rotation of Access and Error Logs

This procedure configures the Directory Proxy Server access log. To configure the Directory Proxy Server error log, perform the same procedure but replace access with error.

You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

  1. (Optional) View the properties of the access log.


    $ dpconf get-access-log-prop -h host -p port
    
  2. (Optional) View valid values for the properties of the access log.

    $ dpconf help-properties access-log
  3. To rotate logs when they reach a certain size, set the following properties:


    $ dpconf set-access-log-prop -h host -p port \
     log-rotation-policy:size log-rotation-size:maximum file size
    

    If the unit of the maximum file size is not specified, the default unit of bytes is used. When the log file reaches the defined size, the log is rotated. The file size must be at least 1 Mbyte and no more than 2 Gbytes.

    For an example of how to rotate logs by size, see Rotating the Log Based on Log Size.

  4. To rotate logs periodically, irrespective of the log size, set the following properties:


    $ dpconf set-access-log-prop -h host -p port \
     log-rotation-frequency:interval in months, weeks, hours, or minutes \
     log-rotation-policy:periodic \
     log-rotation-start-day:day in week (1-7) or day in the month (1-31) \
     log-rotation-start-time:time of day (hhmm)
    

    If the log is configured for rotation on the 31st of the month but the month has fewer than 31 days, the log is rotated on the first day of the following month.

    For examples of how to rotate logs periodically, see Rotating the Log Based on Time.

  5. To rotate logs periodically if the log file is big enough, set the log-rotation-frequency and log-min-size properties.


    $ dpconf set-access-log-prop -h host -p port \
     log-rotation-frequency:interval in months, weeks, hours, or minutes \
     log-rotation-policy:periodic log-min-size:minimum file size
     log-rotation-start-day:day in week (1-7) or day in the month (1-31) \
     log-rotation-start-time:time of day (hhmm)
    

    The log-min-size property represents the minimum size of the log. The rotation takes place at the scheduled time only if the log file is bigger than the specified size.

    If the log is configured for rotation on the 31st of the month but the month has fewer than 31 days, the log is rotated on the first day of the following month.

    For an example of how to rotate logs periodically if the file size is big enough, see Rotating the Log Based on Time and Log Size.