You should not rely on the start-daemon.sh script's strategy for rotating logs in production. That is more or less a hack for scenarios where you're running "out of the tarball" rather than a properly integrated and configured deployment. You're right that it only rotates when that script is run to (re)start the service.
The default "out of the box" configuration for log4j uses a ConsoleAppender, so your logs are likely to go to STDOUT captured as a file ending in .out by our default scripts while STDERR is captured by a file ending in .err. Some attempt You have many options for capturing logs in a deployed system. My personal favorite is to use a systemd unit to manage your service, and to keep the ConsoleAppender in log4j, so your logs will be managed by systemd-journald, and whatever system logging configuration you have set up. Another alternative is to use the RollingFileAppender, as Mike suggested, or you can use any other system you like. The out of the box config is merely a starting point. I would not rely on it in production. Ultimately, the decision for how to run the services and manage logs is up to you. We try to provide options and examples in the form of out-of-the box configuration and scripts, as a starting point only, but these aren't likely to be useful to everyone (nor ideal for anyone). On Tue, Nov 23, 2021 at 11:58 AM Mike Miller <mmil...@apache.org> wrote: > > Are you using Log4j? Log4j has > https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html > > On Tue, Nov 23, 2021 at 11:15 AM Ligade, Shailesh [USA] > <ligade_shail...@bah.com> wrote: >> >> Hello, >> >> Currently logs (all tserver, master) are getting huge and sometimes fills up >> entire disk. They only get rotated when i restart service. I saw that code >> in start-daemon.sh script >> >> Is there a way to use rollingfileappender? I tried to rotate using logrotate >> but it is still logging into old log file (now master_xxx.out.1 file) >> >> I saw some examples under templates folder but there is no information on >> which java classes can go to a log file. e.g. package x,y,z can go to >> master_xxx out file and package kzb can go to monitor.. >> >> Thanks >> >> -S