All Products
Search
Document Center

Function Compute (2.0):LogConfig

Last Updated:Mar 03, 2024
ParameterTypeDescriptionExample
object

The log configuration of the function.

logstorestring

The name of the Logstore.

test-prj
projectstring

The name of the project.

test-logstore
enableRequestMetricsboolean

Specifies whether to enable request-level metrics. If you enable this feature, you can view the amount of time and memory consumed for a specific invocation of each function in the service. Valid values:

  • false: disables the collection of request-level metrics.
  • true: enables the collection of request-level metrics. This is the default value.
true
enableInstanceMetricsboolean

Specifies whether to enable the collection of instance-level metrics. If you enable this feature, you can view core metrics, such as CPU utilization, memory usage, network conditions of instances, and the number of requests that an instance concurrently processes. Valid values:

  • false: disables the collection of instance-level metrics. This is the default value.
  • true: enables the collection of instance-level metrics.
true
logBeginRulestring

The log segmentation rule. Logs are segmented based on the log segmentation rule. The log blocks that are obtained after the segmentation are written to Log Service. Valid values:

  • None: disables the log segmentation rule. This is the default value.
  • DefaultRegex: sets the log segmentation rule to the default regex rule. If you set this parameter to DefaultRegex, logs are segmented based on the data in a log. For example, the line that contains 2021-10-10 in the log is considered as the first line of a log block. The first line and the subsequent lines that do not contain dates in the log are written to Log Service as a whole.
DefaultRegex