We have our java based application(s) [ we are using SpringBoot and Dropwizard ], following a microservices architecture, running on K8s clusters.
We are using log4j to print out log messages. We have configured log4j to write logs to a file. We are finding it very difficult to access these logs [ Currently we exec into the docker container and look through the logs ]. I was doing some research and many people have suggested setting log4j to write logs to the standard output stream or console rather than files. But we want the logs to be preserved for a longer duration [ more like a long time archival ].
So for this, looks like the standard is EFK or ELK [ open-source options ]. I just wanted to understand what are the best practices/configurations that one needs to follow in order to have solid logging for applications using log4j. Deploying and configuring EFK or ELK a good option? If so, could anybody let me know how I should modify my log4j properties to send logs to the stack?