No logs on a container page

On a container page (Infrastructure > Hosts > Containers > <some container> > Logs) I see no logs:

Although I’m sure the infrastructure agent is installed and working properly. Because I can see docker logs on the Logs page.

Am I missing something?


Thank you for reaching out to us. How are you sending the logs to New Relic? Are you using Forward your logs using the infrastructure agent?

Hi -

I’ve had a similar issue, where the container logs don’t seem to be associated with the container metrics (clicking the log menu item from the containers list doesn’t show any logs, even though they are in the overall logs view).

One thing I noticed while troubleshooting today - The logs are being shipped with the host’s entity ID, not the container’s. So when trying to pull up container-specific logs from the containers page, none of the logs from /var/lib/docker/containers/*/*.log on the host are associated with the running containers.

Is that the expected behavior - that only logs going directly from a container to NR would show up from the container’s overview?

1 Like

Ya, I’m seeing this too.

It’s probably because it’s coming from a generic log file, so there’s no dynamic attributes. I’m thinking that the container would need to ship logs directly with explicit attributes.

So, does anyone has idea how to solve this problem? Is there any way to show logs using container name not id?

The query used in the UI element is looking to match containerName from the log attributes to the container. Whichever application is writing the logs will need to pass the containerName attribute in the log payload.

Because of this, you will not see container logs in the container view UI. The best way to query your logs is directly in the log UI. A workaround for missing the containerName attribute would be to set some custom attributes in your logging config to better isolate any data you may need:

Another step would be to query based on the filePath of a given container rather than the containerName.

Example: filePath:/var/lib/docker/containers/

I am also faced with similar problem.
I am using newrelic infrastructure agent. The agent runs fine.
The issue is there are no container logs (I have 3 containers running on the system). There is CPU and other metrics which appears on the dashboard. But no logs for anything.

What is the way forward?

Hello @shailendra.thakur,

Welcome to the community!

I see that you are able to see some metrics from your infrastructure agent, but are still unable to see logs. Have you had a chance to go through our troubleshooting document regarding logs? It may help you get this up and running: No log data appears in the UI | New Relic Documentation.

Please let us know if this was useful or not and we will continue to help out!