Logging Configuration

Logs intended for the user can be seen in the CLI output. But here, not all detailed development logs are visible. To view detailed logs of the CFG6 ConfigCore, you can find them in the following folder:

  • Windows: %LocalAppData%\Vector\DaVinci\dvcfg\logs

  • Linux: $XDG_STATE_HOME/Vector/DaVinci/dvcfg/logs

The Log4J configuration file specifies which logging level is assigned to each class or package. The logging level is applied to the specified element and automatically inherited by all child packages and classes.

The logging configuration of the DaVinci Configurator 6 can be extended with custom Log4J configuration file fragments.

<Configuration>
    <Loggers>
        <Logger name="your.generator" level="trace">
            <AppenderRef ref="LiveLogAppender"/>
        </Logger>
    </Loggers>
</Configuration>
  • The logger for the custom your.generator package is set to trace.

    • The LiveLogAppender is attached to the your.generator logger, which additionally prints its output to the CLI console.

NOTE: The CLI console output will never show log messages below the info level, those are only available in the DaVinci Configurator 6 core logfile (see the Detailed Logs section above).

The monitorInterval attribute can be set on the Configuration element to enable automatic reloading of Log4J configuration changes while ConfigCore is running.

Log4J configuration fragments can be applied using one or both of the following methods:

  • Place the configuration in the <user home directory>/.DaVinciCfg/log4j.xml file, and/or

  • Specify the configuration file path in the DVCFG_LOGGING_CONFIG environment variable.

Customizing ScriptLogger Logging

The scriptLogger is configured with the info level by default and can be reconfigured with the following configuration:

Sample of custom log4j.xml to adjust log level
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    <Loggers>
        <Logger name="com.vector.cfg.user.com.vector.cfg.automation.script" level="debug">
        </Logger>
    </Loggers>
</Configuration>

In the following example, only messages printed via scriptLogger.info(…​) and scriptLogger.debug(…​) will be logged to the detailed log file (see the Detailed Logs section). Messages printed via scriptLogger.trace(…​) will be ignored.

Script with log messages at different levels
import static com.vector.cfg.automation.api.ScriptApi.*
daVinci {
   scriptTask("Task1", DV_APPLICATION) {
      code {
           scriptLogger.info "!!!First info message!!!"
           scriptLogger.debug "!!!First debug message!!!"
           scriptLogger.trace "!!!First trace message!!!"
      }
   }
}

The CLI console output will show the following entries:

CLI Log
[INFO]  Executing script task "script:Task1"
[INFO]  !!!First info message!!!
[INFO]  Execution of script task "script:Task1" successfully finished.

The DaVinci Configurator 6 log file will contain the following entries:

DaVinci Configurator 6 Log
INFO  script                         - Executing script task "script:Task1"
INFO  script                         - !!!First info message!!!
DEBUG script                         - !!!First debug message!!!
INFO  script                         - Execution of script task "script:Task1" successfully finished.