Using a sidecar container to collect logs

The second option when it comes to collecting logs is to run a sidecar container for each application, as shown in the following diagram:

Figure 6: Running a log collector as a sidecar container

While this approach might feel a bit more cumbersome compared to using the infrastructure already built into Kubernetes, it can work quite nicely in cases where the following happens: