Log forwarding doesn't work in Docker

Hi,

I pulled latest newrelic/infrastructure image and put it on docker-compose, everything is up but no logs appears.

Dockerfile
FROM newrelic/infrastructure:latest
COPY newrelic-infra.yml /etc/newrelic-infra.yml
COPY logging.yml /etc/newrelic-infra/logging.d/

newrelic-infra.yml
license_key: ******

logging.yml
logs:
- name: panel
file: /applogs/laravel-2021-11-25.log

docker-compose.yml
newrelic:
image: newrelic-infra:latest
build:
context: ./newrelic-infra
container_name: newrelic-infra
cap_add:
- SYS_PTRACE
privileged: true
volumes:
- ./app/storage/logs:/applogs:ro
restart: unless-stopped

I didn’t add /:/host volume to docker-compose because I run docker on my windows 10 laptop, and I don’t need cpu, memory usage at this stage, I only want logs forwarding

When I check container logs, it keep throwing error like:
time="2021-11-25T07:11:40Z" level=error msg="can't get sample from sampler" component="Sampler routine" error="open /host/proc/loadavg: no such file or directory" samplerName=SystemSampler

which I think is normal since I didn’t mount host root dir to container’s /host dir.

But when I search for “laravel”, i get nothing, it seems the agent didn’t try to open my log file, I’m guessing it stuck in collecting infra metrics.

is there any solution for this?

Thank you

Hi @ethanfordd,

Welcome to the Community and thank you for reaching out!

At this time log forwarding is not supported with the Docker container for infrastructure monitoring agents. While it has been considered, due to additional dependencies that need to be worked on, there are no plans to add it to the roadmap at this time.