Skip to content

Backport of NET-3181 - Allow log file naming like Nomad into release/1.15.x#18629

Merged
asheshvidyut merged 4 commits intorelease/1.15.xfrom
backport/NET-3181-consul-GH-Issue-15709-Allow-log-file-naming-like-Nomad/fully-beloved-lobster
Sep 4, 2023
Merged

Backport of NET-3181 - Allow log file naming like Nomad into release/1.15.x#18629
asheshvidyut merged 4 commits intorelease/1.15.xfrom
backport/NET-3181-consul-GH-Issue-15709-Allow-log-file-naming-like-Nomad/fully-beloved-lobster

Conversation

@hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #18617 to be assessed for backporting due to the inclusion of the label backport/1.15.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@absolutelightning
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: unable to process merge commit: "4b9586e3d6113ce1efb67d7194edc51e7dc14dd2", automatic backport requires rebase workflow

The below text is copied from the body of the original PR.


Description

Fixes - #15709
Currently consul logs files like this consul-{timestamp}.log
This change will create log files like this -

asheshvidyut@asheshvidyut-H2GX766V9T /var/log » ls | grep consul
consul-1693400777323096000.log
consul-1693400777323902000.log
consul-1693400777324364000.log
consul-1693400777324796000.log
consul-1693400777325255000.log
consul-1693400777325694000.log
consul-1693400777326075000.log
consul-1693400777326486000.log
consul-1693400777326847000.log
consul-1693400777327154000.log
consul.log
asheshvidyut@asheshvidyut-H2GX766V9T /var/log »

So basically there will always be a consul.log with the latest logs in it.

Testing & Reproduction steps

make dev
sudo ./bin/consul agent -dev -log-rotate-max-files 10 -log-file /var/log/ -log-rotate-bytes 50
Open browser and hit localhost:8500 couple of times. This will create log files and I verified the content.
consul.log had the latest logs as depicted by the timestamps of logs.

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/NET-3181-consul-GH-Issue-15709-Allow-log-file-naming-like-Nomad/fully-beloved-lobster branch 2 times, most recently from 4c4630a to d733743 Compare August 31, 2023 16:21
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/NET-3181-consul-GH-Issue-15709-Allow-log-file-naming-like-Nomad/fully-beloved-lobster branch from c08f4da to 84befba Compare August 31, 2023 16:21
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging August 31, 2023 16:21 Inactive
@github-actions github-actions bot added the theme/telemetry Anything related to telemetry or observability label Aug 31, 2023
Copy link
Collaborator

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@vercel vercel bot temporarily deployed to Preview – consul August 31, 2023 16:26 Inactive
* fixes file name for consul

* added log file

* added tests for rename method
@asheshvidyut asheshvidyut marked this pull request as ready for review September 4, 2023 09:55
…15709-Allow-log-file-naming-like-Nomad/fully-beloved-lobster
@asheshvidyut asheshvidyut enabled auto-merge (squash) September 4, 2023 09:55
@asheshvidyut asheshvidyut merged commit bfa612c into release/1.15.x Sep 4, 2023
@asheshvidyut asheshvidyut deleted the backport/NET-3181-consul-GH-Issue-15709-Allow-log-file-naming-like-Nomad/fully-beloved-lobster branch September 4, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme/telemetry Anything related to telemetry or observability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants