[TT-13727] Add RFC3339 compliant option for consistent GW application logs#8157
Conversation
|
This pull request introduces a configurable logging format to enable RFC3339 compliant timestamps, ensuring more consistent and machine-readable application logs for the Tyk Gateway. Files Changed AnalysisThe changes are centered around the
Architecture & Impact Assessment
Logging Initialization Flowgraph TD
A[Gateway Startup] --> B{Read `log_format` from config};
B --> C["log.SetupFormatter(format)"];
C --> D{Switch on format};
D --|text or default|--> E[Create TextFormatter w/ RFC3339];
D --|json|--> F[Create JSONFormatter w/ RFC3339];
D --|legacy|--> G[Create TextFormatter w/ legacy timestamp];
subgraph "Apply Formatter"
E --> H[Set Tyk logger AND global logrus logger];
F --> H;
G --> I[Set ONLY Tyk logger];
end
H --> J[Consistent RFC3339 Logs];
I --> K[Legacy Formatted Logs];
Scope Discovery & Context ExpansionThe impact of this change is application-wide. By modifying the global The default value for Metadata
Powered by Visor from Probelabs Last updated: 2026-05-05T12:58:38.426Z | Triggered by: pr_updated | Commit: f4dde3e 💡 TIP: You can chat with Visor using |
✅ Security Check PassedNo security issues found – changes LGTM. ✅ Security Check PassedNo security issues found – changes LGTM. \n\nArchitecture Issues (1)
✅ Performance Check PassedNo performance issues found – changes LGTM. ✅ Quality Check PassedNo quality issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2026-05-05T12:58:28.430Z | Triggered by: pr_updated | Commit: f4dde3e 💡 TIP: You can chat with Visor using |
73ae2ea to
bd7720f
Compare
bd7720f to
87f0b35
Compare
MFCaballero
left a comment
There was a problem hiding this comment.
HI @shults changes look good but can we adjust the config comments https://github.com/TykTechnologies/tyk/blob/master/config/config.go#L1240 to account for these new options as this is automated for docs? We might also need to update https://github.com/TykTechnologies/tyk/blob/master/cli/linter/schema.json#L965
Hi @MFCaballero. Thank you for your response. It makes sense. Would you mind reviewing the changes? |
23c1911 to
f4dde3e
Compare
🚨 Jira Linter FailedCommit: The Jira linter failed to validate your PR. Please check the error details below: 🔍 Click to view error detailsNext Steps
This comment will be automatically deleted once the linter passes. |
|
|
/release to release-5.8 |
|
/release to release-5.13 |
|
|
|
✅ Cherry-pick successful. A PR was created: #8179 |
… logs (#8157) <!-- Provide a general summary of your changes in the Title above --> <!-- Describe your changes in detail --> <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> <!-- Why is this change required? What problem does it solve? --> <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why (cherry picked from commit 432bcba)
…consistent GW application logs (#8157) (#8179) [TT-13727] Add RFC3339 compliant option for consistent GW application logs (#8157) <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why [TT-13727]: https://tyktech.atlassian.net/browse/TT-13727?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: Yaroslav Kotsur <[email protected]>
…onsistent GW application logs (#8157) (#8178) Cherry-pick of `432bcba341df25f1f35292f07075008d65c65a98` from `master` to `release-5.8` requires manual resolution. **Conflicts detected:** 3 - gateway/server.go Tips: - Check out this branch locally and run: `git cherry-pick -x 432bcba` - Resolve conflicts (including submodules if any), then push back to this branch. Original commit: 432bcba --------- Co-authored-by: Tyk Bot <[email protected]> Co-authored-by: Yaroslav Kotsur <[email protected]>



Description
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist