Logs docker or other

i like toknow where to search for applications log that run in docker and where for docker container log problem.

docker logs canbe used for application log or for container problem?

It kind of depends what your consider a container problem. Logs on the container runtime level will not be part of docker logs. But everything inside the container that logs to STDOUT and STDERR will be visible in docker logs.

Its a common practice to log everything to the console, instead of writing log files, as they might polute the containers filesystem if not mapped out into volumes and/or be trimmed to not grow indefinitely. Another popular approach is to use a remote log management server and send the logs there.

if i use syslog to send all log to remote server.
maybe when container crash than with ps -a i can see it.next can i see in some log information about this?or can i see it with docker logs that container crash?

Your posts are minimalistic to the level that I am not realy able to make sense of them.
Can you put them in other words please?

Meanwhile, may I point you to the documentation about logging: lhttps://docs.docker.com/config/containers/logging/configure/

@meyay is right about the amount of information but I try to guess what you mean.

When a container crashes, it means a process inside that container crashes. If that generates a log, you will see it in the remote syslog if you collect your docker logs there. If a parent process of that container is just killed without the chance to wait for its children to stop, you won’t see that in the container logs, but you may see that in the same syslog server if you collect not just container logs but the host logs as well. And I say “you may see” because if you just kill a parent process and it is not the result of something that generates logs like “containerd-shim-runc-v2 was killed by XY”, then I don’t think you would see that anywhere, but I may be wrong.

In kubernete case if i configure loki to collect logs then this loki know to collect logs from every container within pod?

Probably, but I don’t use Loki and you could get a better answer from the documentation I think. There are miltiple tools to collect and forward logs aspects of choosing a log aggregator or logging agent, so you have to choose what suits you.