Apache Flink® clusters have a default Apache Log4j® configuration. It is possible to customize the generated logging configuration as described on this page.
For Deployments executed in session mode, you have to configure Logging in the SessionCluster resource referenced by the Deployment.
You can configure log levels for individual loggers via the log4jLoggers attribute:
kind: Deployment spec: template: spec: logging: log4jLoggers: "": INFO # Root log level com.company: DEBUG # Log level of com.company
The root log level is configured by using the empty string
"" as key.
Logging profiles are Log4j configuration templates pre-configured by the Ververica Platform administrator. A profile named
default is always available.
kind: Deployment spec: template: spec: logging: loggingProfile: default
In general, you should expect the Ververica Platform administrator to set up the default logging profile as required by your environment. Typically, the Deployment Defaults will provide a default value for the loggingProfile to use.
Please consult the Logging & Metrics documentation for more details on how to configure logging profiles.
Log4j Template (Advanced)¶
The Log4j configuration template gives you full control over the Apache Log4j® configuration of your Flink cluster in case that the logging profile does not provide enough flexibility.
kind: Deployment spec: template: spec: logging: log4j2ConfigurationTemplate: | <?xml version="1.0" encoding="UTF-8" standalone="no"?> <Configuration xmlns="http://logging.apache.org/log4j/2.0/config" strict="true"> ... </Configuration>
Custom Log4j templates follow the XML configuration format of Log4j and have higher precedence than a configured profile.
Please consult the Logging & Metrics documentation for more details on how to configure Log4j templates.