Skip to main content
In Self-Service Analytics, you can use Fluentd as a logging layer to which you can direct the logs for various components of Self-Service Analytics. This allows you to customize the log output to meet the needs of your environment. Self-Service Analytics leverages Fluentd’s unified logging layer to collect logs via a central API. Fluentd can be configured to aggregate logs to various data sources or outputs. For example, if you are directing all log files from your zoomdata-websocket.log and zoomdata-errors.log to a Fluentd server, you can add one of Fluentd’s plug-ins to write the log files to Elasticsearch to analyze web client errors for your environment. Unified logging does not replace Self-Service Analytics’s default logging architecture. It only augments that experience with an option for those wanting additional logging control. By default, unified logging is disabled and needs to be enabled for each microservice you want captured in Fluentd. If written to a data store compatible with Self-Service Analytics’s connectors, Self-Service Analytics can then be used to analyze and visualize your logs. The selected data store must be supported by Self-Service Analytics’s connectors if you plan to view the log files in Self-Service Analytics dashboards. A list of supported data stores is provided in Data Connector Reference. The selected data store should be available and configured in conjunction with Fluentd to receive logs. At a high level, the steps to set up Fluentd are as follows:
  1. Set up a database to store the Fluentd log files. Typically, customers store log files in a log capture service such as Elasticsearch or in a database server such as PostgreSQL.
  2. Configure Fluentd logging for your Self-Service Analytics installation. See Configure Unified Logging Using Fluentd. This includes configuring the Fluentd td-agent.conf file to identify the Self-Service Analytics microservice log data you want logged.
  3. Enable unified logging and configure the host and port information for your Fluentd server for each microservice log file from which you are extracting data for Fluentd logging. See Enable Unified Logging in Self-Service Analytics Using Fluentd.

Enable Unified Logging in Self-Service Analytics Using Fluentd

Identify the Self-Service Analytics microservices for which you want activity logged to Fluentd. A complete list of the Self-Service Analytics microservices is given in Self-Service Analytics Microservice Name Reference, but not all microservices support unified logging. You can enable unified logging for these microservices:
  • Web microservices (zoomdata.properties)
  • Query engine (query-engine.properties)
  • Data source connectors (see Connector Properties and Property Files for a list of property files)
  • Data Writer framework (data-writer-postgresql.properties)
Enable unified logging using Fluentd for a Self-Service Analytics microservice
  1. On your Self-Service Analytics server, edit the .properties file for the microservice. For example, etc/zoomdata/query-engine.properties.
  2. Define the following parameters in the .properties file:
    Property SyntaxDescription
    logging.unified.level = <log-level>Specify one of the following log levels for <log-level>: ERROR, WARN, INFO, DEBUG, TRACE, or OFF. If set to OFF, Fluentd unified logging is disabled.
    logging.unified.tag = <service-tag>Specify the unique tag for the Self-Service Analytics microservice, used in grouping logs. This tag must be unique throughout Self-Service Analytics.
    Supply the Self-Service Analytics microservice name for <service-tag>. For example, logging.unified.tag = query-engine. This is important because the tag identifies which microservice the log message applies to.
    Valid values are query-engine, zoomdata-server, data-writer-postgresql, and edc-<connector-name> (where <connector-name> is one of the names listed in Connector Properties and Property Files).
    logging.unified.label = <service-label>Specify a more verbose label for the Self-Service Analytics microservice.
    logging.unified.host = <yourFluentdServerIPaddress>Specify the IP address of the Fluentd logging server.
    logging.unified.port = <yourFluentdServerPort>Specify the port of the Fluentd logging server.
  3. Save your changes and exit the .properties file.
  4. Restart the Self-Service Analytics server.
On the Fluentd server, you can then direct your logs to a data source of your choice. For information and steps, see Fluentd’s documentation on Output.

Configure Unified Logging Using Fluentd

For information and steps on installing Fluentd, refer to Fluentd’s installation documentation. If Fluentd is not installed on the same server as the Self-Service Analytics, you will need to obtain the host and port numbers for the Fluentd server. This section provides describes how to configure Fluentd to log Self-Service Analytics log data. Configure Fluentd for logging Self-Service Analytics log data
  1. Run the following command on the server where Self-Service Analytics is installed to install td-agent on that server.
  2. Browse to the /etc folder on the Self-Service Analytics server to verify that td-agent is installed in the /etc/td-agent folder.
  3. Install the Fluentd plugin for the data store you are using to store your Fluentd logs. Refer to your Fluentd documentation for more information. For example, if you are using an Elasticsearch database to store Fluentd logs. run the following command to install the Fluentd Elasticsearch plugin on the Self-Service Analytics server.
  4. Modify the td-agent.conf file in the /etc/td-agent folder using the following template. The following is an example of td-agent.conf using an Elasticsearch database for Fluentd logs.
  5. Restart td-agent.
  6. Complete the steps described in Enable Unified Logging in Self-Service Analytics Using Fluentd to enable Fluentd logging by Self-Service Analytics.

Configure Self-Service Analytics Logs

The microservices used in Self-Service Analytics write logs to their corresponding service’s log files by default. You can configure Self-Service Analytics to write these logs to the console only, or to write logs both to the console and the service’s log files. Structured logging is also supported. See Structured Logging. Every service config file includes two properties you can use to define where the logs are written:
  • log.console.level - edit to define the types of logs to write to the console
  • log.file.level - edit to define the types of logs to write to the files

Log Properties in Config Files

If you install using the bootstrap script, logging to files is enabled by default. You can reroute the logging to the console as needed to customize your installation.
If the value of log properties is set to OFF, Self-Service Analytics access logs are not written. For all other cases (ALL, ERROR, WARN, DEBUG, and INFO) access logs are written to the selected destination: file, console or both.
  • Bootstrap installation: The *.jvm file specifies log.console.level=OFF and log.file.level=ALL to support compatibility with earlier versions of Self-Service Analytics.

Values for log.file.level and log.console.level

The following table lists possible values for log.file.level and log.console.level.

Enable Logging for a Service to the Console

Enable logging to the console and append the desired corresponding value of the properties to the appropriate service configuration file.
  • Use log.console.level=ALL to route duplicates of all logs to the console.
  • Use log.console.level=ERROR to route only duplicates of errors to the console.
  • Alternatively, use log.console.level=ALL and log.console.level=ERROR to have all logs in files and errors duplicated to the console.
Adjust the values to meet your needs, then restart the service after you have edited the config.
Self-Service Analytics services have two config files, *properties and *.jvm. If you add log configuration properties to both files, the priority of *.jvm is higher than *. properties.

Consul Logging

By default, Consul writes logs to the console, but you can duplicate logs to files if needed. Configure Consul Logs to Duplicate to Files:
  1. Edit the Consul config file, consul.json. For Linux installations, this is located in /opt/zoomdata/conf/consul.json.
  2. Add the following properties:
    Adjust the path to your log file and other log configuration properties as needed for your environment. In Linux environments, the log is located in /opt/zoomdata/logs, and in <install-path>/logs for Windows environments. See Consul documentation for more information.

Structured Logging

Self-Service Analytics supports structured logging. You can enable for installations done via bootstrap, and is enabled by default for Kubernetes environments.

Components Support for Structured Logging

  • zoomdata-web
  • query engine
  • admin server
  • screenshot service
  • data writer
  • data connectors
  • self service reports

Enable Structured Logging

In bootstrap environments, set the property log.structured.enabled to true in the config files of your microservices to output logs in JSON format to the STDOUT destination. Logs output to the FILE logs destination are sent in plain text. See Configuration Property Files. In Kubernetes environments, structured logging is enabled by default. To disable, use one of the following approaches:
  • Set the environment variable LOG_STRUCTURED_ENABLED to false to disable logging for specific services.
  • Set structuredLogsEnabled in values.yaml to false to disable logging for all services.
  • For Consul, change the log_json value to false in the consul.server.extraConfig section of values.yaml.

Self-Service Analytics Log Files Reference

Self-Service Analytics uses the following log files. You can configure Self-Service Analytics to write these logs to the console in addition to or instead of the service files. See Configure Self-Service Analytics Logs.

Log Unification

Self-Service Analytics has unified logback configuration throughout Self-Service Analytics microservices. You can configure Self-Service Analytics to write these logs to the console in addition to or instead of the service files. See Configure Self-Service Analytics Logs and Self-Service Analytics Log Files Reference.

Log Configuration Properties

Adjust these properties to set up logging for your environment.
NameDefault ValueDescription
install.dir.Use to evaluate the value of logs.dir.
logs.dir${install.dir}/logsThe location of the log file and error log file.
spring.application.namezoomdata-serviceUse to evaluate the default values of logs.file-name.
logs.file-name${spring.application.name}Name of log file. Log file suffix: .log. Error log file suffix: error.log.
log.console.levelALLThe maximum level of logs to print to stdout. See Log File Values.
log.file.levelALLThe maximum level of logs to print to the log file. See Log File Values.
log.password.regex(?i)PASSWORD=[a-zA-Z0-9!@#\$%\^\*\&amp;]*Regular expression used to detect passwords in log output. Replaces with PASSWORD=****.
log.url-password.regex(?&lt;=://)[^:]+:[^@]+@Regular expression used to detect and remove credential in URLs and remove the credentials.
log.sanitization.enabledtrueThe default, true, is specified in logging.properties.
Toggles sanitization of log message via org.apache.commons.text.StringEscapeUtils.escapeJava.
log.file.size20The maximum size of the log file in MB. When that size is reached, the file is renamed using this pattern: {log.file-name}.log.%i.
log.file.count5Maximum number of log files.
log.error.file.size5The maximum size of the error log file in MB. When that size is reached, the file is renamed using this pattern: {log.file-name}-error.log.%i.
log.error.file.count5Maximum number of error log files.
syslog.log.levelOFFSyslog log level. See Log File Values.
syslog.host127.0.0.1Syslog host name.
syslog.port514Syslog port number.
syslog.suffix${spring.application.name}Syslog suffix. Used to distinguish applications.
trace.requestsfalseAdds the MDC value of requestId to log output. Propagate value using X-REQUEST-ID http header.

Log File Values

Other Configuration Properties

Both Zoomdata-Web and Query Engine have properties you can adjust to suit your needs as well.

Zoomdata-Web

Query Engine

Set Logging Levels

Every logging level can be changed using a standard spring boot approach. Specify the corresponding property, as shown below.
The logback.zoomdata property, previously used to control the log level of some loggers, has been removed. Use a standard spring boot approach to specify appropriate properties.

Default Log File Names

Self-Service Analytics’s microservices each have a series of default log files where you can find captured events.

Log File Migration Reference

With the introduction of unified log properties and unified logback configurations, a number of log files have new names. When you upgrade your Self-Service Analytics environment from an earlier version, you may need to rename properties overwritten by external configurations.

Zoomdata-web

Query Engine

EDC

Admin Service, Config Server, Data Writer, and Screenshot Service