Logging with Load Balancer

Load Balancer posts entries to a server log, a manager log, a metric monitor log (logging communications with Metric Server agents), and a log for each advisor you use.

About this task

You might want to configure logging for a variety of reasons, like troubleshooting or keeping records. Load Balancer can log activities to varying degrees of detail and keep the log files on your system. You can customize the following logging features:
  • Setting the logging level to define the expansiveness of the messages written to the log. At level 0, errors are logged and Load Balancer also logs headers and records of events that happen only once (for example, a message about an advisor starting to be written to the manager log). Level 1 includes ongoing information, and so on, with level 5 including every message produced to aid in debugging a problem if necessary. The default for the manager, advisor, server, or subagent logs is 1.
  • Setting the maximum size of a log. When the log file reaches the specified size, it is saved as <component>.log.full, and subsequent logs are written in the currently running file. In next cycle, the existing <component>.log.full is deleted Load Balancer will create a new one.
    Important: You cannot set the log size to a value that is smaller than the current one. The higher you set the log level, the more carefully you should choose the log size. At level 0, it is probably safe to leave the log size to the default of 1MB; however, when logging at level 3 or higher, you should limit the size without making it too small to be useful.

Log entries are time stamped so you can tell the order in which they were written.

Tip: You can use similar steps for logging for the other components of Load Balancer.

Procedure

  • Display the current settings for the server log,
    Use the dscontrol logstatus command:
    dscontrol logstatus
  • Configure the logging level or maximum log size for a server log.
    Use the dscontrol set command:
    dscontrol set loglevel level logsize size
    where:
    • level is 0-5.
    • size is unlimited or a file size in bytes.
  • Configure the logging level or maximum log size for a manager log.
    Use the dscontrol manager command:
    dscontrol manager loglevel level
    
    dscontrol manager logsize size
    where:
    • level is 0-5.
    • size is unlimited or a file size in bytes.
  • Configure the logging level or maximum log size for the metric monitor log that logs communication with Metric Server agents.
    Use the dscontrol manager metric set command:
    dscontrol manager metric set loglevel level
    
    dscontrol manager metric set logsize size
  • Configure the logging level or maximum log size for an advisor log.
    Use the dscontrol advisor command:
    dscontrol advisor loglevel name cluster@port level 
    
    dscontrol advisor logsize name cluster@port size  
    where:
    • cluster@port the cluster is the address in IP address format or symbolic name. The port is the number of the port that the advisor is monitoring. The cluster value is optional on the advisor commands, but the port value is required. If the cluster value is not specified, then the advisor will start running on the port for all clusters. If you specify a cluster, then the advisor will start running on the port, but only for the cluster you have specified. Read the Enabling advisors to manage load balancing topic for more information.