We have our internal infrastructure that takes care of log rotation and because ES has inbuilt log rotation by default, the glob pattern does not match ultimately canceling out any log rotation.
Is there a way to disable log rotation in ES via configuration? If so, can you please provide an example?
I'll be upfront and say first that you are entering unsupported territory, and you are at risk of losing log messages if you switch to using an external rotation strategy. There's no guarantee that when the log file is externally manipulated Log4j transitions seamlessly and you don't lose log messages or have log messages partially written across two files. It doesn't matter if you use a rename/new strategy, or something like copytruncate.
If you insist on doing this, you need to change the appender in the default log4j2.properties configuration from the rolling file appender to a different appender like the file appender, and remove the size-based triggering policy. You'll need to consult the Log4j docs for the specific parameters for your use case.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.