Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Conversation

@zrhoffman
Copy link
Member

@zrhoffman zrhoffman commented Jan 6, 2022

#6450 fixes #6446 by revert the Traffic Router rollover file patterns to the one previously used in log4j.properties with Log4j 1.2, as well as ensuring that traffic_router.log only keeps 1 archive.


Which Traffic Control components are affected by this PR?

  • Traffic Router
  • Automation - Ansible Roles

What is the best way to verify this PR?

  1. For convenience, change the value of SizeBasedTriggeringPolicy in log4j2.xml from 200MB and 100MB to 1MB so log file rollovers happen more frequently
  2. Fill access.log, access.log.1, traffic_router.log, and traffic_router.log.1 with content so they are over 1MB in size:
    cd /opt/traffic_router/var/log;
    for file in {access.log,traffic_router.log}{,.1}; do
      for ((i = 0; i < 117528; i++)); do
        echo "$file" >> "$file";
      done;
    done
    sync;
  3. Start Traffic Router and verify that traffic_router.log rolls over, resulting in the old traffic_router.log being moved to traffic_router.log.1 and the old traffic_router.log.1 being removed
  4. Send requests to Traffic Router until access.log rolls over 10 times.
  5. Verify that you end up these logs related to access.log:
    access.log
    access.log.1
    access.log.2
    access.log.3
    access.log.4
    access.log.5
    access.log.6
    access.log.7
    access.log.8
    access.log.9
    access.log.10
    

If this is a bugfix, which Traffic Control versions contained the bug?

  • 6.0.2
  • 5.1.5

PR submission checklist

@zrhoffman zrhoffman added Traffic Router related to Traffic Router high impact impacts the basic function, deployment, or operation of a CDN regression bug a bug in existing functionality introduced by a new version logging related to logging infrastructure labels Jan 6, 2022
@zrhoffman zrhoffman added this to the 6.1.0 milestone Jan 6, 2022
@zrhoffman zrhoffman added the ansible Related to the Ansible roles label Jan 6, 2022
@srijeet0406 srijeet0406 self-requested a review January 7, 2022 07:04
Copy link
Contributor

@srijeet0406 srijeet0406 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Tested manually on CIAB to make sure the output is as expected. LGTM!

@srijeet0406 srijeet0406 merged commit 47e7e66 into apache:master Jan 7, 2022
@zrhoffman zrhoffman deleted the log4j2-file-pattern branch January 7, 2022 08:53
ocket8888 pushed a commit that referenced this pull request Jan 12, 2022
* Archive logs using an integer counter

* Keep a maximum of 1 archive of traffic_router.log (traffic_router.log.1)

(cherry picked from commit 47e7e66)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ansible Related to the Ansible roles high impact impacts the basic function, deployment, or operation of a CDN logging related to logging infrastructure regression bug a bug in existing functionality introduced by a new version Traffic Router related to Traffic Router

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revert automatic log rotation Log4J configuration

2 participants