Set log level

In some cases the cause of a problem cannot be identified in the default log level. In this case the log level can be adjusted accordingly and the information output can be increased.

The log level can be set via the application.yml, the Web API or the system portal. The Web API takes effect immediately, requires neither a restart nor any additional configuration and is therefore the recommended way on a running instance. As of Relution 26.4, the system portal requires the corresponding actuator endpoint to be enabled once.

The DEBUG log level should only be used for analysis purposes, as significantly more information is written to the log and the log grows accordingly. Once the analysis is complete, the log level is to be set back to INFO.

Logfile Location

Where to find log files for Docker, Linux, and Windows is described under Relution Logs →.


Activation of the system portal

The following section is added to the application.yml in the Relution directory:

relution:
  spring-boot-admin:
    enabled: true

The change only takes effect after the Relution server is restarted. Afterwards, the System Portal entry appears for system administrators in the support menu (question mark icon in the header).

Correct indentation of each line is essential (two spaces per level). It is recommended to deactivate the system portal again after finishing the work.

Enabling the actuator endpoints

As of Relution 26.4, only the health endpoint is exposed by default for security reasons. The instance view of the system portal therefore shows the Details section only. The Loggers section appears once the corresponding endpoint has been enabled in the application.yml of the Relution server:

management:
  endpoints:
    web:
      exposure:
        include:
          - health
          - loggers

The list replaces the default configuration entirely. health has to remain part of it, as otherwise the health endpoint is dropped along with the status display of the system portal and the health checks of load balancers and cluster nodes.

A restart of the Relution server is required for the change to take effect.

Further sections of the system portal can be added individually following the same pattern:

Section in the system portalEndpoint
Loggersloggers
Environmentenv
Metricsmetrics
Thread Dumpthreaddump
Cachescaches
Scheduled Tasksscheduledtasks
Mappingsmappings
Configuration Propertiesconfigprops
Logfilelogfile
Quartzquartz

The system portal displays the section names in the browser language; in a German or French browser, the names appear in that language.

The actuator endpoints are served on management port 8099 without authentication. This port must not be reachable from untrusted networks. The endpoints env, configprops and heapdump additionally expose configuration values and memory contents including credentials. Any endpoint enabled for an analysis is therefore to be disabled again afterwards.

Activation of the DEBUG Log in the System Portal

This requires an activated system portal as well as an enabled loggers endpoint, see the two preceding sections.

  1. Relution is accessed with a system administrator account. The default username is admin.

  2. System Portal is opened from the support menu (question mark icon).

    Relution support menu showing System Portal navigation link for admin access

  3. The application is then expanded and the associated instance is opened via Open instance details.

    Spring Boot Admin instance selection screen in Relution system portal

  4. The Loggers section is opened.

    Spring Boot Admin Loggers section tab in Relution system portal

  5. The search is used to set the corresponding Logger to DEBUG. ROOT activates all Loggers and should therefore only be used in exceptional cases, as a lot of content is generated quickly. In the example, the AppleMdmProfileRenewalService logger has been set to DEBUG.

    Relution system portal Logger list with AppleMdmProfileRenewalService set to DEBUG log level

The setting takes effect immediately; no service restart is required. When restarting the Relution service or Docker container, the log will be set back to INFO.


Keeping the DEBUG log active beyond a restart

Since the DEBUG log is set back to INFO after a restart of the instance, it is not possible to log initial errors during the startup process, e.g. in the context of an LDAP connection, in the way described above. For this there is the possibility to define the log in the application.yml. This is loaded directly at startup and thus activates the DEBUG log.

The following entries are inserted into the application.yml without indentation, i.e. starting at the first column. The change takes effect after the Relution server is restarted.

It is recommended to activate one or more logs individually and in a targeted manner. To do this, the individual loggers are added one below the other in the file.


Multiple individual logs

logging.level.io.relution.security.ldap: DEBUG
logging.level.io.relution.apple.mdm.AppleMdmResource: DEBUG

In the example, LDAP functionality and AppleMdmResource would now be enabled in the DEBUG log. The names of the loggers can be looked up in the system portal as long as the loggers endpoint is enabled; otherwise they correspond to the package or class name shown in the log.

The following entry enables DEBUG for the package io.relution, i.e. almost the entire Relution code, but without third-party libraries such as the LDAP SDK or EclipseLink:

logging.level.io.relution: DEBUG

Set ROOT to DEBUG

Logging at the ROOT level may generate a lot of content quickly. This functionality should only be used in absolutely exceptional cases for short analysis activities. Even small installations may experience significant performance degradation.

The ROOT logger covers all loggers including third-party libraries:

logging.level.root: DEBUG

Setup Loglevel with a Logging User via the Web API

It is possible to create a special logging user on the system organisation, which can comfortably change the log level via the Web API. This saves the manual editing of the YAML configuration file as well as a restart of the server.

This path requires neither an activated system portal nor any enabled actuator endpoint and is therefore the recommended way to change log levels on a running instance. As in the system portal, the log levels are reset to their initial value when the instance is restarted.

1. Create authorisation and user

To create the logging user, a new authorisation must first be created on the system organisation, where the permission under System → Logging configuration is activated and saved. Then a new user can be created exclusively for the logging access, to which the previously created authorisation is assigned. Note: The system administrator has this authorisation by default.

Relution system organization role settings showing System Logging configuration permission option

Relution user creation form for dedicated logging user with role assignment

2. Create an Access Token

An Access Token can be created for this new user to facilitate handling. To do this, the user must first log in and create the token via the user profile. In the dialog, the default value Management portal remains selected under API scopes, as the logging endpoint belongs to this scope; a token without this scope is rejected by the endpoint. The Access Token is only displayed once, another token can be created if required.

Relution user profile showing access token creation option for API authentication

Relution access token display shown once after creation with copy option

3. Controlling the log level via the Web API

To control the log level via the Web API, the Web API entry is opened in the system organisation from the support menu (question mark icon in the header); the Web API opens in a new tab. There, Authorize opens the authentication dialog for the logging user. Here the access token of the logging user can be used to facilitate access and automatically add authentication at curl. In the item userAccessTokenAuth the token must be inserted and authorised. Note: Alternatively, signing in as the system administrator of the system organization makes entering the token unnecessary.

At the point logging, the required logging points as well as the log level can be defined and executed. The endpoint is /api/management/v1/system/logging. The packageNames field accepts several package or class names in one call, as well as Spring log groups such as web or sql:

{
  "packageNames": ["io.relution.security.ldap", "io.relution.apple.mdm.AppleMdmResource"],
  "logLevel": "DEBUG"
}

Successful execution is confirmed with code 204 and the executed curl command is displayed. In a cluster installation, log levels set via the Web API automatically apply to all nodes. Changes, resets and restores are recorded in the audit log.

Relution Web API Authorize dialog for entering logging user access token

Relution Web API logging endpoint showing logger name and log level selection fields

Package names and log level in the form of the logging endpoint in the Relution Web API

Curl command and response code 204 after executing the request in the Relution Web API

In addition, it is possible to reset the logging to the default settings. A reset (/reset) expects a list of package or group names and resets only these; a restore (/restore) resets all loggers changed via the Web API.

Relution Web API showing logging reset and restore endpoint for default settings

4. Controlling the log level via the curl command

It is also possible to control the log level via the curl command by saving the curl generated via the Web API as an alias or script for future use.

Relution Web API curl command for controlling log level via command line

5. Use for support staff or other employees

To grant access to a user, for example a Relution support staff member, it is sufficient either to pass on the token or to provide the Relution support team with the email address of the logging user that is linked to a valid Relution instance.


Secure Mail Gateway

The Secure Mail Gateway runs as a separate container. The methods described here (Web API, system portal, application.yml of the Relution server) do not affect the SMG. Its log level is set in the application.yaml of the SMG container, and docker logs smg shows its logs. Instructions are available under Installing Secure Mail Gateway →.

How helpful was this article?