Skip to content

Commit

Permalink
fix conversion flow for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tuunit committed May 9, 2024
1 parent 9451f49 commit b16acde
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
36 changes: 18 additions & 18 deletions docs/docs/configuration/alpha_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ They may change between releases without notice.
| `cookie` | _[Cookie](#cookie)_ | Cookie is used to configure the cookie used to store the session state.<br/>This includes options such as the cookie name, its expiry and its domain. |
| `session` | _[SessionOptions](#sessionoptions)_ | Session is used to configure the session storage.<br/>To either use a cookie or a redis store. |
| `pageTemplates` | _[PageTemplates](#pagetemplates)_ | PageTemplates is used to configure custom page templates.<br/>This includes the sign in and error pages. |
| `Logging` | _[Logging](#logging)_ | Logging is used to configure the logging output.<br/>Which formats are enabled and where to write the logs. |
| `logging` | _[Logging](#logging)_ | Logging is used to configure the logging output.<br/>Which formats are enabled and where to write the logs. |

### AzureOptions

Expand Down Expand Up @@ -326,11 +326,11 @@ LogFileOptions contains options for configuring logging to a file

| Field | Type | Description |
| ----- | ---- | ----------- |
| `Filename` | _string_ | |
| `MaxSize` | _int_ | |
| `MaxAge` | _int_ | |
| `MaxBackups` | _int_ | |
| `Compress` | _bool_ | |
| `filename` | _string_ | |
| `maxSize` | _int_ | |
| `maxAge` | _int_ | |
| `maxBackups` | _int_ | |
| `compress` | _bool_ | |

### Logging

Expand All @@ -340,18 +340,18 @@ Logging contains all options required for configuring the logging

| Field | Type | Description |
| ----- | ---- | ----------- |
| `AuthEnabled` | _bool_ | |
| `AuthFormat` | _string_ | |
| `RequestEnabled` | _bool_ | |
| `RequestFormat` | _string_ | |
| `StandardEnabled` | _bool_ | |
| `StandardFormat` | _string_ | |
| `ErrToInfo` | _bool_ | |
| `ExcludePaths` | _[]string_ | |
| `LocalTime` | _bool_ | |
| `SilencePing` | _bool_ | |
| `RequestIDHeader` | _string_ | |
| `File` | _[LogFileOptions](#logfileoptions)_ | |
| `authEnabled` | _bool_ | |
| `authFormat` | _string_ | |
| `requestEnabled` | _bool_ | |
| `requestFormat` | _string_ | |
| `standardEnabled` | _bool_ | |
| `standardFormat` | _string_ | |
| `errToInfo` | _bool_ | |
| `excludePaths` | _[]string_ | |
| `localTime` | _bool_ | |
| `silencePing` | _bool_ | |
| `requestIdHeader` | _string_ | |
| `fileOptions` | _[LogFileOptions](#logfileoptions)_ | |

### LoginGovOptions

Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/options/alpha_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type AlphaOptions struct {

// Logging is used to configure the logging output.
// Which formats are enabled and where to write the logs.
Logging Logging `yaml:"logging,omitempty"`
Logging Logging `json:"logging,omitempty"`
}

// Initialize alpha options with default values and settings of the core options
Expand Down
34 changes: 17 additions & 17 deletions pkg/apis/options/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ import (

// Logging contains all options required for configuring the logging
type Logging struct {
AuthEnabled bool `yaml:"authEnabled"`
AuthFormat string `yaml:"authFormat,omitempty"`
RequestEnabled bool `yaml:"requestEnabled"`
RequestFormat string `yaml:"requestFormat,omitempty"`
StandardEnabled bool `yaml:"standardEnabled"`
StandardFormat string `yaml:"standardFormat,omitempty"`
ErrToInfo bool `yaml:"errToInfo,omitempty"`
ExcludePaths []string `yaml:"excludePaths,omitempty"`
LocalTime bool `yaml:"localTime"`
SilencePing bool `yaml:"silencePing,omitempty"`
RequestIDHeader string `yaml:"requestIdHeader,omitempty"`
File LogFileOptions `yaml:"fileOptions,omitempty"`
AuthEnabled bool `json:"authEnabled"`
AuthFormat string `json:"authFormat,omitempty"`
RequestEnabled bool `json:"requestEnabled"`
RequestFormat string `json:"requestFormat,omitempty"`
StandardEnabled bool `json:"standardEnabled"`
StandardFormat string `json:"standardFormat,omitempty"`
ErrToInfo bool `json:"errToInfo"`
ExcludePaths []string `json:"excludePaths,omitempty"`
LocalTime bool `json:"localTime"`
SilencePing bool `json:"silencePing"`
RequestIDHeader string `json:"requestIdHeader,omitempty"`
File LogFileOptions `json:"fileOptions,omitempty"`
}

// LogFileOptions contains options for configuring logging to a file
type LogFileOptions struct {
Filename string `yaml:"filename,omitempty"`
MaxSize int `yaml:"maxSize,omitempty"`
MaxAge int `yaml:"maxAge,omitempty"`
MaxBackups int `yaml:"maxBackups,omitempty"`
Compress bool `yaml:"compress,omitempty"`
Filename string `json:"filename,omitempty"`
MaxSize int `json:"maxSize,omitempty"`
MaxAge int `json:"maxAge,omitempty"`
MaxBackups int `json:"maxBackups,omitempty"`
Compress bool `json:"compress,omitempty"`
}

// loggingDefaults creates a Logging structure, populating each field with its default value
Expand Down

0 comments on commit b16acde

Please sign in to comment.