Skip to main content

Changing log levels

Sometimes, you'll want to use a different value than an Agent Controller's or Agent Proxy's default value for logging. For example, when troubleshooting a problem with your agent or when trying out a new feature.

The following sections detail how to change the log level of your:

note

The process to change your Agent Controller's or Agent Proxy's log level does differ depending on your chosen deployment type. Make sure to use the correct tab in the sections to change your log levels.

See Log level reference for complete details about each agent's log levels.

Change Agent Controller log level​

Use the following tabs to set change your Agent Controller's log level using the AEMBIT_LOG_LEVEL environment variable:

  1. Log into your Agent Controller.

  2. Open the Aembit Agent Controller service at /etc/systemd/system/aembit_agent_controller.service.

    You may have to open this as root using sudo.

  3. Under [Service], update or add Environment=AEMBIT_LOG_LEVEL=<log_level>, and set the log level you want. For example:

    [Service]
    ...
    User=aembit_agent_controller
    Restart=always
    Environment=AEMBIT_TENANT_ID=abc123
    Environment=AEMBIT_STACK_DOMAIN=useast2.aembit.io
    Environment=AEMBIT_DEVICE_CODE=
    Environment=AEMBIT_AGENT_CONTROLLER_ID=A12345
    Environment=ASPNETCORE_URLS=http://+:5000,http://+:9090
    Environment=AEMBIT_LOG_LEVEL=<log_level>
    StandardOutput=journal
    StandardError=journal
    ...
  4. Reload the Aembit Agent Controller config:

    systemctl daemon-reload
  5. Restart the Aembit Agent Controller service:

    systemctl restart aembit_agent_controller.service

Change Agent Proxy log level​

Use the following tabs to set change your Agent Proxy's log level using the AEMBIT_LOG_LEVEL environment variable:

  1. Log into your Agent Proxy.

  2. Open the Aembit Agent Proxy service at /etc/systemd/system/aembit_agent_proxy.service.

    You may have to open this as root using sudo.

  3. Under [Service], update or add Environment=AEMBIT_LOG_LEVEL=<log_level>, and set the log level you want. For example:

    [Service]
    ...
    User=aembit_agent_proxy
    Restart=always
    StandardOutput=journal
    StandardError=journal
    TimeoutStopSec=20
    Nice=-20
    LimitNOFILE=65535
    Environment=AEMBIT_SIGTERM_STRATEGY=immediate
    Environment=AEMBIT_AGENT_CONTROLLER=https://my-proxy-service:5000
    Environment=AEMBIT_DOCKER_CONTAINER_CIDR=
    Environment=CLIENT_WORKLOAD_ID=
    Environment=AEMBIT_AGENT_PROXY_DEPLOYMENT_MODEL=vm
    Environment=AEMBIT_SERVICE_PORT=51234
    Environment=AEMBIT_LOG_LEVEL=<log_level>
    ...
  4. Reload the Aembit Agent Proxy config:

    systemctl daemon-reload
  5. Restart the Aembit Agent Proxy service:

    systemctl restart aembit_agent_proxy.service