Skip to main content
Version: 7.2405.x.x LTS

nevisAdmin 4 Log Files

The nevisAdmin 4 log files can be found in the following location: /var/opt/nevisadmin4/logs

nevisAdmin 4 Log

The nevisadmin4.log is the log of the nevisAdmin 4 application itself. It is helpful for investigations when the application is not behaving as expected. The log level is configurable.

Logback Configuration

The log level can be configured per package/class in a logback.xml file. A restart of nevisAdmin 4 is not required to adjust the configuration.

The logback.xml file is scanned for changes every 5 seconds.

The file can be found in the following location: /var/opt/nevisadmin4/conf/logback.xml

Default /var/opt/nevisadmin4/conf/logback.xml

<included>
<logger name="ch.nevis.admin.v4.core.project" level="info" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</logger>
<logger name="ch.nevis.admin.v4.app.command" level="info" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</logger>
<logger name="org.springframework.http" level="warn" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</logger>
<logger name="org.springframework.web" level="warn" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</logger>
<logger name="com.fasterxml.jackson" level="warn" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</logger>
</included>

Custom Logging

It is possible to log any custom file into a directory of choice. For this, first define a custom appender and then create a new logger, who is referencing the custom appender. See also the following example, which uses a simple FileAppender. For a more advanced setup, check the official logback documentation.

Custom log file extension in logback.xml

<included>
<appender name="MY-CUSTOM-FILE" class="ch.qos.logback.core.FileAppender">
<file>${logdir:-logs}/my_custom.log</file>
<!--
Can use any path instead of the 'logdir' value, but preferable
<file>/var/opt/nevisadmin4/my_custom_logs/my-custom.log</file>
-->
<encoder>
<pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="ch.nevis.admin.v4.core.project" level="debug" additivity="false">
<appender-ref ref="MY-CUSTOM-FILE" />
</logger>
</included>

Own log file for a class

<included>
<appender name="FILE-PROJECT-IMPORTER" class="ch.qos.logback.core.FileAppender">
<file>${logdir:-logs}/FileProjectImporter.log</file>
<encoder>
<pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="ch.nevis.admin.v4.core.project.job.FileProjectImporter" level="trace" additivity="false">
<appender-ref ref="FILE-PROJECT-IMPORTER" />
</logger>
</included>

Syslog

Logback has an appender to support logging into syslog. For configuration details, see the SyslogAppender section in the official logback documentation.

Deployment and Generation Logs

Proceed as follows to log deployment and generation activities in a separate file.

Add the following lines to the file logback.xml. This will show the deployment and PKI activities that happen during the deployment of your configuration in the file deployment.log.

Deployment log

<included>
<appender name="DEPLOYMENT" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${logdir:-logs}/deployment.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${logdir:-logs}/deployment-%i.log</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>10</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>50MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<logger name="ch.nevis.admin.v4.app.command.deployment" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.core.project.deployment" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.direct.orchestration" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.k8s.orchestration" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.yaml.inventory" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.infra.pki" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.core.common.pki" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.core.common.secret" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
</included>

Generation and Validation log

You may add the lines below to also include configuration generation logs into the file. This will produce logs for the following activities:

  • Deployment.
  • Background project validation triggered by changes in the project, for example changing and saving a pattern.
  • Reports, like for example the Application Mapping Report.
<included>
<logger name="ch.nevis.admin.v4.core.provisioning" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.core.generation" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.base.generation" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.nevisproxy" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.nevisauth" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.nevisidm" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.authcloud" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.nevismeta" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.nevisfido" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
<logger name="ch.nevis.admin.v4.plugin.nevisdetect" level="debug" additivity="false">
<appender-ref ref="DEPLOYMENT" />
</logger>
</included>

Logging of Application Metrics

To display information about job execution and RAM usage, you can add the following lines to the file logback.xml.

Application metrics log

<included>
<logger name="ch.nevis.admin.v4.core.common.util.Metrics" level="debug" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</logger>
</included>

Audit Log

The audit.log file tracks every modification request done via the REST API. This includes all modification operations done by users in the nevisAdmin 4 GUI, such as:

  • creating projects and inventories,
  • permission changes,
  • updating patterns and variables,
  • updating inventories, and
  • deployment.

The file can be found in the following location: /var/opt/nevisadmin4/logs/audit.log

The following log excerpt shows some typical activities:

2018-10-19 21:27:23,075 [qtp594858858-33] - admin, source=tenant(key=SIVEN): CreateTenantCommand
2018-10-19 21:27:25,081 [qtp594858858-33] - admin, source=project(key=SIVEN-WEBSHOP-MASTER): CreateProjectCommand
2018-10-19 21:27:25,160 [qtp594858858-21] - admin, source=inventory(key=SIVEN-INVENTORY-SIVEN): CreateInventoryCommand
2018-10-19 21:27:25,223 [qtp594858858-36] - admin, source=inventory(key=SIVEN-INVENTORY-SIVEN): UpdateInventoryContentCommand
2018-10-19 21:27:25,454 [qtp594858858-36] - admin, source=project(key=SIVEN-WEBSHOP-MASTER): UpsertProjectVariablesCommand
2018-10-19 21:27:25,900 [qtp594858858-14] - admin, source=project(key=SIVEN-WEBSHOP-MASTER),pattern(id=d3f51b1fcbd3eaf433588645): UpsertPatternCommand
2018-10-19 21:27:26,309 [qtp594858858-21] - admin, source=project(key=SIVEN-WEBSHOP-MASTER),pattern(id=6abafff4a15cd1c122d1e4f6): UpsertPatternCommand
2018-10-19 21:27:27,785 [qtp594858858-35] - admin, source=project(key=SIVEN-WEBSHOP-MASTER),pattern(id=bd73c0740ae895fc8ae722f9): UpsertPatternCommand
2018-10-19 21:31:54,637 [qtp594858858-20] - admin, source=deployment-run(id=ad2822662d84b54eda96408e): UpsertDeploymentRunCommand
2018-10-19 21:31:54,891 [qtp594858858-17] - admin, source=deployment-run(id=ad2822662d84b54eda96408e): StartDeploymentRunGenerationCommand
2018-10-19 21:31:57,456 [qtp594858858-20] - admin, source=deployment-run(id=ad2822662d84b54eda96408e): StartDeploymentPlanCommand
2018-10-19 21:32:03,478 [qtp594858858-33] - admin, source=deployment-run(id=ad2822662d84b54eda96408e): StartDeploymentDeployCommand
2018-10-19 21:32:42,327 [qtp594858858-33] - admin, source=deployment-run(id=ad2822662d84b54eda96408e): DeleteDeploymentRunCommand

Here are some hints on interpreting the log file. The hints refer to line 6:

  • [qtp594858858-14]: The ID of the java thread that executed the operation.
  • admin: The user who performed the operation.
  • source: The primary object affected by the operation, such as project(key=SIVEN-WEBSHOP-MASTER) ,pattern(id=d3f51b1fcbd3eaf433588645).This means: The pattern with ID "d3f51b1fcbd3eaf433588645" in project "SIVEN-WEBSHOP-MASTER".
  • UpsertPatternCommand: The operation that was executed (upsert means: Object created or updated).

Environment Configuration

Log related properties can be set in the environment configuration file env.conf. Any change requires the restart of nevisAdmin 4 to be effective.

The env.conf file can be found in the following location: /var/opt/nevisadmin4/conf/env.conf

PropertyDescriptionenv.conf DefaultApplication Default
logback.includeConfigFileLocation of the logback.xml file./var/opt/nevisadmin4/conf/logback.xmletc/logback.xml
logdirDirectory where the log files are placed./var/opt/nevisadmin4/logslogs
logback.stdout.levelLog level of the standard output (console).INFOINFO
root.levelSet the root log level. Effective for every package. Not advised to change it to DEBUG. Can produce 50Mb of logs in less than 1 minute.-INFO
audit.levelLog level of the audit.log file.-INFO