Viewing Logs
Anchore services produce detailed logs that contain information about user interactions, internal processes, warnings and errors. The verbosity of the logs is controlled using the logging.log_level setting in config.yaml (for manual installations) or the corresponding ANCHORE_LOG_LEVEL environment variable (for docker compose or Helm installations) for each service.
The log levels are DEBUG, INFO, WARNING, ERROR, and CRITICAL, where the default is INFO. Most of the time, the default level is sufficient as the logs will container WARNING, ERROR and CRITICAL messages as well. But for deep troubleshooting, it is always recommended to increase the log level to DEBUG in order to ensure the availability of the maximum amount of information.
Anchore logs can be accessed by inspecting the docker logs for any anchore service container using the regular docker logging mechanisms, which typically default to displaying to the stdout/stderr of the containers themselves - for example:
# docker ps
...
33c809f1803a anchore/anchore-engine:latest "/docker-entrypoint.…" 22 hours ago Up 22 hours (healthy) 8228/tcp aevolume_engine-catalog_1
...
# docker logs aevolume_engine-analyzer_1
[service:anchore-enterprise-analyzer-v5.12.0] [2024-11-12T11:24:27.326839+00:00] [MainProcess] [MainThread] [INFO] [anchore_enterprise.bootstrap/init_monitor_thread():458] | Starting monitor thread
[uvicorn:anchore-enterprise-analyzer-v5.12.0] [2024-11-12T11:24:27.329481+00:00] [MainProcess] [MainThread] [INFO] [uvicorn.main/run():579] | Started server process [110]
[uvicorn:anchore-enterprise-analyzer-v5.12.0] [2024-11-12T11:24:27.330474+00:00] [MainProcess] [MainThread] [INFO] [asyncio.runners/run():190] | Waiting for application startup.
[uvicorn:anchore-enterprise-analyzer-v5.12.0] [2024-11-12T11:24:27.344984+00:00] [MainProcess] [MainThread] [INFO] [asyncio.runners/run():190] | Application startup complete.
[uvicorn:anchore-enterprise-analyzer-v5.12.0] [2024-11-12T11:24:27.346445+00:00] [MainProcess] [MainThread] [INFO] [asyncio.runners/run():190] | Uvicorn running on http://0.0.0.0:8228
...
...
The logs themselves are also persisted as logfiles inside the Anchore service containers. Executing a shell into any Anchore service container and navigating to /var/log/anchore
, you will find the service log files. For example, using the same analyzer container service as described previously.
# docker exec -t -i aevolume_engine-analyzer_1 /bin/bash
[anchore@687818c10b93 anchore-engine]$ cat /var/log/anchore/anchore-worker.log
[service:anchore-enterprise-analyzer-v5.12.0] [2024-11-12T11:24:27.326839+00:00] [MainProcess] [MainThread] [INFO] [anchore_enterprise.bootstrap/init_monitor_thread():458] | Starting monitor thread
[uvicorn:anchore-enterprise-analyzer-v5.12.0] [2024-11-12T11:24:27.329481+00:00] [MainProcess] [MainThread] [INFO] [uvicorn.main/run():579] | Started server process [110]
[uvicorn:anchore-enterprise-analyzer-v5.12.0] [2024-11-12T11:24:27.330474+00:00] [MainProcess] [MainThread] [INFO] [asyncio.runners/run():190] | Waiting for application startup.
[uvicorn:anchore-enterprise-analyzer-v5.12.0] [2024-11-12T11:24:27.344984+00:00] [MainProcess] [MainThread] [INFO] [asyncio.runners/run():190] | Application startup complete.
[uvicorn:anchore-enterprise-analyzer-v5.12.0] [2024-11-12T11:24:27.346445+00:00] [MainProcess] [MainThread] [INFO] [asyncio.runners/run():190] | Uvicorn running on http://0.0.0.0:8228
...
...
If you are using Kubernetes to run Anchore Enterprise, you can retrieve the logs from the service pods directly using kubectl
commands:
Tip: You can find the desired pod name with
kubectl get pods
# k8s-inventory kubectl logs -n <your-namespace> <your-anchore-pod-name>
[service:anchore-enterprise-apiext-v5.12.0] [2024-11-12T18:11:21.475751+00:00] [MainProcess] [WSGI_2] [INFO] [anchore_enterprise.common.service/log_request():948] [req-id-aa93785c77c94d7081b1cff51d59d0aa] | 172.18.0.15:50682 - "GET /health HTTP/1.1" 200 request:0bytes response:5bytes 1.13ms
[service:anchore-enterprise-apiext-v5.12.0] [2024-11-12T18:11:21.494813+00:00] [MainProcess] [WSGI_0] [INFO] [anchore_enterprise.common.service/log_request():948] [req-id-fdec0048c96348b9ae3385866908931f] | 172.18.0.15:50694 - "GET /version HTTP/1.1" 200 request:0bytes response:86bytes 1.27ms
[service:anchore-enterprise-apiext-v5.12.0] [2024-11-12T18:11:30.499957+00:00] [MainProcess] [WSGI_2] [INFO] [anchore_enterprise.common.service/log_request():948] [req-id-8c6dd69ca53241958cfc63287ff97403] | 172.18.0.16:50360 - "GET /metrics HTTP/1.1" 200 request:0bytes response:18483bytes 14.08ms
[service:anchore-enterprise-apiext-v5.12.0] [2024-11-12T18:11:31.533531+00:00] [MainProcess] [WSGI_0] [INFO] [anchore_enterprise.common.service/log_request():948] [req-id-7d0b21bb200d491db6a63fffaeb95bf2] | 172.18.0.15:51316 - "GET /health HTTP/1.1" 200 request:0bytes response:5bytes 1.5ms
[service:anchore-enterprise-apiext-v5.12.0] [2024-11-12T18:11:31.539215+00:00] [MainProcess] [WSGI_2] [INFO] [anchore_enterprise.common.service/log_request():948] [req-id-6090039eb148412cb50bd64ceb61a634] | 172.18.0.15:51324 - "GET /version HTTP/1.1" 200 request:0bytes response:86bytes 0.94ms
[service:anchore-enterprise-apiext-v5.12.0] [2024-11-12T18:11:40.149191+00:00] [MainProcess] [WSGI_0] [INFO] [anchore_enterprise.common.service/log_request():948]
Last modified November 26, 2024