There are other ways to capture or store logs... Tools or toolsets like Telegraf. OT but could be of help
Thank you Mr. Funk. My request is two-folds a) archive the log files elsewhere (not the "logs" folder) based on some policy b) clean up (delete) the archived files based on some policy. If I'm not mistaken, your suggestion may address the latter but nothing on the former? Thanks and regards, ----------------------------------------------------- Quoc -----Original Message----- From: Tim Funk <funk...@apache.org> Sent: Tuesday, March 18, 2025 1:10 PM To: Tomcat Users List <users@tomcat.apache.org> Subject: [EXTERNAL] Re: Archive localhost_access_log Personally. I rely on a daily cron with a find by time and the -delete flag. Where the time to keeps is based on policy. -Tim On Tue, Mar 18, 2025 at 9:52 AM Nguyen, Quoc A. (QUANTUM MANAGEMENT, LLC) <quoc.ngu...@va.gov.invalid> wrote: > Hello, > > Tomcat server version: 9.0.98. > > server.xml configuration for AccessLogValve: > > <Valve className="org.apache.catalina.valves.AccessLogValve" > directory="logs" prefix="localhost_access_log" suffix=".log" maxDays="7" > pattern="%h %{X-Forwarded-For}i %t %I "%m %U" %{local}p %s %b %D" > resolveHosts="false" /> > > Everything works fine. Now, I have a requirement to archive these log > files similar to log4j <RollingFile> (pattern is already taken care of > in the valve) with <Policies> (archive when the file size reaches > certain > size) and <DefaultRolloverStrategy> (cleanup archived files). > > Is there a way to archive these logs via the configuration in the valve? > If not, what the best way to go about it: a custom class that > implements ValveBase or extends AccessLogValve or do something else entirely? > > > B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB��[��X��ܚX�KK[XZ[�\�\��][��X��ܚX�P�X�] �\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[�\�\��Z[�X�] �\X�K�ܙ�B�