Updated on 2023-11-08 GMT+08:00

Log Files Configuration

Viewing error logs is an important method for locating faults. Therefore, you need to properly plan log output to minimize the impact on system performance. Suggestions for planning log files:

  1. Use log4j2 or logback to output logs. Output logs to a file without depending on stdout of the container.
  2. Open the metrics log, export this log to an independent file, for example, metrics.log, and export service logs to another file, for example, servicecomb.log. Configure metrics parameters as follows:
    servicecomb:
      metrics:
        window_time: 60000
        invocation:
          latencyDistribution: 0,1,10,100,1000
        Consumer.invocation.slow:
          enabled: true
          msTime: 3000
        Provider.invocation.slow:
          enabled: true
          msTime: 3000
        publisher.defaultLog:
          enabled: true
          endpoints.client.detail.enabled: true
  3. Open access log and export it to an independent log file.
  4. The service log containing trace ID is printed in a formatted manner. You can develop a handler and configure it before Provider Handler. After receiving and processing a request, the handler prints logs respectively. This helps you locate faults and quickly search for related logs using AOM.