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

Fix Common Controller Issues #2215

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions adapter/pkg/config/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package config

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
Expand Down Expand Up @@ -107,7 +106,7 @@ func ReadLogConfigs() *LogConfig {
adapterLogConfig = getDefaultLogConfig()
path, err := GetLogConfigPath()
if err == nil {
content, readErr := ioutil.ReadFile(filepath.Clean(path))
content, readErr := os.ReadFile(filepath.Clean(path))
if readErr != nil {
logger.Error("Proceeding with default log configuration as error occured while reading log configurations ", readErr)
} else {
Expand Down
3 changes: 2 additions & 1 deletion common-controller/internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ var applicationKeyMappingMap = make(map[string]ApplicationKeyMapping)

// StartInternalServer starts the internal server
func StartInternalServer() {

gin.SetMode(gin.ReleaseMode)
r := gin.Default()

r.GET("/applications", func(c *gin.Context) {
Expand Down Expand Up @@ -46,7 +48,6 @@ func StartInternalServer() {
}
c.JSON(http.StatusOK, ApplicationKeyMappingList{List: applicationKeyMappingList})
})
gin.SetMode(gin.ReleaseMode)
conf := config.ReadConfigs()
certPath := conf.CommonController.Keystore.CertPath
keyPath := conf.CommonController.Keystore.KeyPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,15 @@ data:
log_config.toml: |
# The logging configuration for Adapter

## Adapter root Level configurations
## Common Controller root Level configurations

logfile = "adapter.log" # This file will be created inside adapter container.
{{- if .Values.wso2.apk.dp.commonController.logging }}
logLevel = "{{ .Values.wso2.apk.dp.commonController.logging.level | default "INFO" }}" # LogLevels can be "DEBG", "FATL", "ERRO", "WARN", "INFO", "PANC"
LogFormat = "{{ .Values.wso2.apk.dp.commonController.logging.logFormat | default "TEXT" }}" # Values can be "JSON", "TEXT"
{{- else }}
logLevel = "INFO" # LogLevels can be "DEBG", "FATL", "ERRO", "WARN", "INFO", "PANC"
LogFormat = "TEXT" # Values can be "JSON", "TEXT"
{{- end }}

[rotation]
MaxSize = 10 # In MegaBytes (MB)
Expand Down
7 changes: 7 additions & 0 deletions helm-charts/values.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,13 @@ wso2:
poolMaxConnIdleTime: "1h"
poolHealthCheckPeriod: "1m"
poolMaxConnLifetimeJitter: "1s"
logging:
# -- Optionally configure logging for common controller.
# LogLevels can be "DEBG", "FATL", "ERRO", "WARN", "INFO", "PANC"
level: "INFO"
# -- Log format can be "JSON", "TEXT"
logFormat: "TEXT"

type
ratelimiter:
# -- Enable the deployment of the Rate Limiter
Expand Down
Loading