---
title: Enable low-level OPC-UA logging
slug: how-tos/HCpR-enable-low-level-logging
docTags: UDglSYuzCeqYsFuKMx-fS
createdAt: 2025-09-01T12:19:16.445Z
---

This page is only relevant for OPC-UA collector versions older than 2.1.0. If the OPC-UA collector version is 2.1.0 or higher, you can simply set the LogLevel to 'trace'.

## Linux

1. Edit the collector’s environment file: `/etc/systemd/system/environments/factry-collector-<UUID>`
2. Add: `OPC_DEBUG=debug`
3. Restart the collector.
4. View logs: `sudo journalctl -u factry-collector-<UUID>.service -f`

## Windows

1. Stop the collector service.
2. Get the `API_TOKEN` from the Registry (`regedit`) at `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\factry-collector-<UUID>` in `Environment`
3. Open a command window and set environment variables:
   - `set OPC_DEBUG=debug`
   - `set API_TOKEN=<API_TOKEN>`
4. Run the collector binary manually (no flags).
5. Watch the logs in the command window.
6. Restart the collector service when done.
