SUSE Support

Here When You Need Us

How to change the log level of "hawk-apiserver" service

This document (000020986) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise High Availability Extension 15

Situation

To troubleshoot Hawk2 issue, it may be required to change the log level of the "hawk-apiserver" service.

Resolution

The log level for the "hawk-apiserver" service can be changed by setting the "loglevel" parameter in the file "/etc/hawk/server.json".

The possible values for the "loglevel" parameter are as follows:
  debug
  info
  warning
  error
  fatal
  panic


By default the "loglevel" parameter is not set in "/etc/hawk/server.json", but the default value is internally set to "info".

For example, to set the log level of the "hawk-apiserver" service to "debug" level, add the "loglevel" parameter to "/etc/hawk/server.json":
  {
    "loglevel": "debug",
    "route": [
      {
        "handler": "monitor",
        "path": "/monitor"
      },
     ......
  }


Restart the hawk service.
For example:
  systemctl restart hawk.service

The "hawk-apiserver" debug messages will now be printed in the system message log.
For example:
... systemd[1]: Starting HA Web Konsole...
... systemd[1]: Started HA Web Konsole.
... hawk-apiserver[18102]: level=info msg="Reading /etc/hawk/server.json..."
... hawk-apiserver[18102]: level=info msg="Listening to https://0.0.0.0:7630\n"
... hawk-apiserver[18102]: level=debug msg="[proxy] / -> unix:///usr/share/hawk/tmp/hawk.sock"
... hawk-apiserver[18102]: level=debug msg="[proxy] /login -> unix:///usr/share/hawk/tmp/hawk.sock"
... hawk-apiserver[18102]: level=debug msg="[file] /usr/share/hawk/public/assets/vendor-420e822e02c390e16b4686904ca61330ef4e6a5b1004951429196a1f3a245f62.css"
... hawk-apiserver[18102]: level=debug msg="[file] /usr/share/hawk/public/assets/authentication-12e2206a5fce0a847386ab20b1906c2d9311f4a3e84f1ed7853c59429a8c5e39.css"

Cause

It is not clear how to change the log level of the "hawk-apiserver" service.

Status

Top Issue

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000020986
  • Creation Date: 24-Feb-2023
  • Modified Date:01-Mar-2023
    • SUSE Linux Enterprise High Availability Extension

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.