Questo contenuto non è disponibile nella lingua selezionata.
Chapter 3. Cluster logging
3.1. Configuring log settings for Serving and Eventing Copia collegamentoCollegamento copiato negli appunti!
You can configure logging for OpenShift Serverless Serving and OpenShift Serverless Eventing using the KnativeServing
and KnativeEventing
custom resource (CR). The level of logging is determined by the specified loglevel
value.
3.1.1. Supported log levels Copia collegamentoCollegamento copiato negli appunti!
The following loglevel
values are supported:
Log level | Description |
---|---|
| Fine-grained debugging |
| Normal logging |
| Unexpected but non-critical errors |
| Critical errors; unexpected during normal operation |
| In debug mode, trigger a panic (crash) |
Using the debug
level for production might negatively affect performance.
3.1.2. Configuring log settings Copia collegamentoCollegamento copiato negli appunti!
You can configure logging for Serving and Eventing in the KnativeServing
custom resource (CR) and KnativeEventing
CR.
Procedure
Configure the log settings for Serving and Eventing by setting or modifying the
loglevel
value in theKnativeServing
andKnativeEventing
CR respectively. Here are two example configurations with all possible logging options set to levelinfo
:KnativeServing CR
Copy to Clipboard Copied! Toggle word wrap Toggle overflow KnativeEventing CR
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.3. Configuring request log settings Copia collegamentoCollegamento copiato negli appunti!
You can configure request logging for your service in the observability
field of your KnativeServing
custom resource (CR).
For information about the available parameters for configuring request logging, see "Parameters of request logging".
Procedure
Configure request logging for your service by modifying the
observability
field in yourKnativeServing
CR:Example
KnativeServing
CRCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.4. Parameters of request logging Copia collegamentoCollegamento copiato negli appunti!
The following table describes parameters used to configure request logging.
Parameter | Type | Description |
---|---|---|
|
Boolean ( |
Set to |
|
Boolean ( |
Set to |
|
Go | Determine the shape of the request logs. Use a single line to prevent logs from being split into multiple records. |
The logging.request-log-template
parameter includes the following functions:
-
Request
is anhttp.Request
representing an HTTP request received by the server. Response
represents the HTTP response and includes the following fields:-
Code
is the HTTP status code. -
Size
is the response size in bytes. -
Latency
is the response latency in seconds.
-
Revision
contains revision details and includes the following fields:-
Name
is the name of the revision. -
Namespace
is the namespace of the revision. -
Service
is the name of the service. -
Configuration
is the name of the configuration. -
PodName
is the name of the pod hosting the revision. -
PodIP
is the IP address of the hosting pod.
-