Skip to content

Commit

Permalink
Merge pull request #2215 from pubudu538/cc
Browse files Browse the repository at this point in the history
Fix Common Controller Issues
  • Loading branch information
pubudu538 authored Apr 1, 2024
2 parents d22c473 + 9678fcb commit 718a5c2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
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

0 comments on commit 718a5c2

Please sign in to comment.