Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: Secondary Logformat entries are not shown when the access log format is json #3501

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

VirajSalaka
Copy link
Contributor

@VirajSalaka VirajSalaka commented Mar 25, 2024

Purpose

Issues

Fixes #

Automation tests

  • Unit tests added: No
  • Integration tests added: No

Tested environments

Locally tested


Maintainers: Check before merge

  • Assigned 'Type' label
  • Assigned the project
  • Validated respective github issues
  • Assigned milestone to the github issue(s)

@@ -78,6 +78,13 @@ func getFileAccessLogConfigs() *config_access_logv3.AccessLog {
for k, v := range logConf.AccessLogs.JSONFormat {
logFields[k] = &structpb.Value{Kind: &structpb.Value_StringValue{StringValue: v}}
}
formattedSecondaryLogFormat := strings.ReplaceAll(logConf.AccessLogs.SecondaryLogFormat, "'", "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we do the other way around?
Let's remove SecondaryLogFormat and read it from a new config JSONFormatSecondary. We can use the value of the map for Text format if needed.

secondaryLogFields := strings.Split(formattedSecondaryLogFormat, " ")
// iterate through secondary log fields and update the logfields map
for _, field := range secondaryLogFields {
logFields[strings.ReplaceAll(strings.TrimSpace(field), "%", "")] =
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to use TrimSpace again ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah nope
will fix

@VirajSalaka VirajSalaka merged commit ee657c6 into wso2:choreo Mar 26, 2024
2 of 3 checks passed
@choreo-cicd
Copy link

[succeeded] : dev-deployment-v2 : 20240326.5

@choreo-cicd
Copy link

[succeeded] Controlplane cluster : dev-deployment-v2 : 20240326.5

@choreo-cicd
Copy link

[succeeded] Dataplane(EastUS) cluster : dev-deployment-v2 : 20240326.5

@choreo-cicd
Copy link

[succeeded] Dataplane(NorthEU) cluster : dev-deployment-v2 : 20240326.5

@choreo-cicd
Copy link

[succeeded] Dataplane(NorthEU) cluster : stage-deployment-v2 : 20240327.2

@choreo-cicd
Copy link

[succeeded] Dataplane(CDP2-WU2) cluster : stage-deployment-v2 : 20240327.2

@choreo-cicd
Copy link

[succeeded] Controlplane cluster : stage-deployment-v2 : 20240327.2

@choreo-cicd
Copy link

[succeeded] Dataplane(EastUS) cluster : stage-deployment-v2 : 20240327.2

@choreo-cicd
Copy link

[failed] Controlplane cluster : prod-deployment-v2 : 20240328.5

@choreo-cicd
Copy link

[succeeded] Dataplane(CDP2-WU2) cluster : prod-deployment-v2 : 20240328.5

@choreo-cicd
Copy link

[succeeded] Dataplane(NorthEU) cluster : prod-deployment-v2 : 20240328.5

@choreo-cicd
Copy link

[succeeded] Dataplane(EastUS) cluster : prod-deployment-v2 : 20240328.5

@choreo-cicd
Copy link

[] Dataplane(EastUS) cluster : prod-deployment-v2 : 20240328.5

@choreo-cicd
Copy link

[] Controlplane cluster : prod-deployment-v2 : 20240328.5

@choreo-cicd
Copy link

[] Dataplane(CDP2-WU2) cluster : prod-deployment-v2 : 20240328.5

@choreo-cicd
Copy link

[] Dataplane(NorthEU) cluster : prod-deployment-v2 : 20240328.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants