Skip to content

Commit

Permalink
feat: add LoggingSpec support
Browse files Browse the repository at this point in the history
  • Loading branch information
whg517 committed Sep 29, 2024
1 parent e652b0c commit 477c857
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions pkg/apis/commons/v1alpha1/logging_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package v1alpha1

type LoggingSpec struct {
// +kubebuilder:validation:Optional
Containers map[string]LoggingConfigSpec `json:"containers,omitempty"`
// +kubebuilder:validation:Optional
EnableVectorAgent *bool `json:"enableVectorAgent,omitempty"`
}

type LoggingConfigSpec struct {
// +kubebuilder:validation:Optional
Loggers map[string]*LogLevelSpec `json:"loggers,omitempty"`
Expand All @@ -12,18 +19,15 @@ type LoggingConfigSpec struct {
}

// LogLevelSpec
// level mapping example:
// level mapping if app log level is not standard
// - FATAL -> CRITICAL
// - ERROR -> ERROR
// - WARN -> WARNING
// - INFO -> INFO
// - DEBUG -> DEBUG
// - TRACE -> DEBUG
//
// |---------------------|-----------------|
// | App log level | kds log level |
// |---------------------|-----------------|
// | CRITICAL | FATAL |
// | ERROR | ERROR |
// | WARNING | WARN |
// | INFO | INFO |
// | DEBUG | DEBUG |
// | DEBUG | TRACE |
// |---------------------|-----------------|
// Default log level is INFO
type LogLevelSpec struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default:="INFO"
Expand Down

0 comments on commit 477c857

Please sign in to comment.