Capturing trace logs in kubernetes

I’m wondering if it is possible to log the trace logs to stdout in the fdbmonitor process or more generally how the k8s controller handles capturing the trace logs.

The operator sends the trace logs from the fdbserver processes to a directory that is mapped to an emptyDir volume. This is designed so that if you want to export the trace logs to another system, you could add a custom sidecar container that accesses that volume and exports the logs.

I think that sending the trace logs to standard output, allowing you to see them through kubectl logs, makes sense as a feature. I believe that would have to be implemented in fdbserver.

Writing to stdout isn’t currently supported, but the trace logging implementation supports writing custom formatters and writers. It shouldn’t be too much effort to make a writer that outputs to stdout rather than a file, and if you wanted it to have a different format that XML or JSON, you could make a different formatter for it too.

Thanks for the feedback! I’m not sure why I didn’t think of it earlier, but a sidecar doing tail -qf is working pretty well.