Apm-server logs

if I pull apm-server:6.7.0 simply from the internet and try and run this container as is, I can't seem to find the logs at all?

I ran:
docker run -it docker.elastic.co/apm/apm-server:6.7.0 /bin/bash

And then ran:
bash-4.2$ cd /var/log/
bash-4.2$ pwd
bash-4.2$ ls
btmp grubby_prune_debug lastlog tallylog wtmp yum.log
bash-4.2$ cd
bash-4.2$ ls
LICENSE.txt NOTICE.txt README.md apm-server apm-server.yml data fields.yml ingest kibana logs
bash-4.2$ cd logs/
bash-4.2$ ls

I am told that the logging on apm-server 6.7.0 should default to /var/log/apm-server

why is it not here?

If I am not mistaken, when you run

docker run -it docker.elastic.co/apm/apm-server:6.7.0 /bin/bash

you override container start script, and the apm server never starts, hence no logging appearing

try running the container first

docker run -d -it --name apm docker.elastic.co/apm/apm-server:6.7.0

and then connecting to it, to see if you find those logs

docker exec -it apm bash

EDIT: also docker image does not log to files by default, you can get the logs by running docker container logs apm based on the above example. If you still want to log to files, you will have to either override the config or build a custom image

1 Like

what specifically should I add so it overrides the config? my understanding was that apm-server by default logs to /var/log. this is what it did when I ran it in the vm

EDIT: you are saying that this same default logging of apm-server to /var/log does not apply to the container I guess?

What I will do is custom configure it to log in a specific directory of the container and work with that. I will overtly put in the config to log to var/log

Either that or I will look at ways to turn docker logs to log to the VM. that would be the second option

/usr/share/apm-server/bin/apm-server -c /etc/apm-server/apm-server.yml --path.logs /var/log &

I used this command in a docker container and its doing what I want it to

Thanks for the help!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.