Skip to content

Commit

Permalink
Fix/missing log level (#691)
Browse files Browse the repository at this point in the history
* release 2.2.0

Signed-off-by: dehaocheng <dehaocheng@kubesphere.io>
Signed-off-by: Jean-Yves <jynolen+github@gmail.com>

* Add missing Log_Level

Signed-off-by: Jean-Yves <jynolen+github@gmail.com>

---------

Signed-off-by: dehaocheng <dehaocheng@kubesphere.io>
Signed-off-by: Jean-Yves <jynolen+github@gmail.com>
Co-authored-by: dehaocheng <dehaocheng@kubesphere.io>
  • Loading branch information
jynolen and wenchajun committed Apr 12, 2023
1 parent 840a840 commit a69991d
Show file tree
Hide file tree
Showing 18 changed files with 226 additions and 1 deletion.
5 changes: 5 additions & 0 deletions apis/fluentbit/v1alpha2/clusterfilter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ type FilterSpec struct {
// A regular expression to match against the tags of incoming records.
// Use this option if you want to use the full regex syntax.
MatchRegex string `json:"matchRegex,omitempty"`
// +kubebuilder:validation:Enum:=off;error;warning;info;debug;trace
LogLevel string `json:"logLevel,omitempty"`
// A set of filter plugins in order.
FilterItems []FilterItem `json:"filters,omitempty"`
}
Expand Down Expand Up @@ -117,6 +119,9 @@ func (list ClusterFilterList) Load(sl plugins.SecretLoader) (string, error) {
if p.Name() != "" {
buf.WriteString(fmt.Sprintf(" Name %s\n", p.Name()))
}
if item.Spec.LogLevel != "" {
buf.WriteString(fmt.Sprintf(" Log_Level %s\n", item.Spec.LogLevel))
}
if item.Spec.Match != "" {
buf.WriteString(fmt.Sprintf(" Match %s\n", item.Spec.Match))
}
Expand Down
2 changes: 1 addition & 1 deletion apis/fluentbit/v1alpha2/clusterfluentbitconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type Service struct {
// File to log diagnostic output
LogFile string `json:"logFile,omitempty"`
// Diagnostic level (error/warning/info/debug/trace)
// +kubebuilder:validation:Enum:=error;warning;info;debug;trace
// +kubebuilder:validation:Enum:=off;error;warning;info;debug;trace
LogLevel string `json:"logLevel,omitempty"`
// Optional 'parsers' config file (can be multiple)
ParsersFile string `json:"parsersFile,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions apis/fluentbit/v1alpha2/clusterinput_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ type InputSpec struct {
// A user friendly alias name for this input plugin.
// Used in metrics for distinction of each configured input.
Alias string `json:"alias,omitempty"`
// +kubebuilder:validation:Enum:=off;error;warning;info;debug;trace
LogLevel string `json:"logLevel,omitempty"`
// Dummy defines Dummy Input configuration.
Dummy *input.Dummy `json:"dummy,omitempty"`
// Tail defines Tail Input configuration.
Expand Down Expand Up @@ -101,6 +103,9 @@ func (list ClusterInputList) Load(sl plugins.SecretLoader) (string, error) {
if item.Spec.Alias != "" {
buf.WriteString(fmt.Sprintf(" Alias %s\n", item.Spec.Alias))
}
if item.Spec.LogLevel != "" {
buf.WriteString(fmt.Sprintf(" Log_Level %s\n", item.Spec.LogLevel))
}
kvs, err := p.Params(sl)
if err != nil {
return err
Expand Down
7 changes: 7 additions & 0 deletions apis/fluentbit/v1alpha2/clusteroutput_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ type OutputSpec struct {
// A user friendly alias name for this output plugin.
// Used in metrics for distinction of each configured output.
Alias string `json:"alias,omitempty"`
// Set the plugin's logging verbosity level. Allowed values are: off, error, warn, info, debug and trace, Defaults to the SERVICE section's Log_Level
// +kubebuilder:validation:Enum:=off;error;warning;info;debug;trace
LogLevel string `json:"logLevel,omitempty"`

// AzureBlob defines AzureBlob Output Configuration
AzureBlob *output.AzureBlob `json:"azureBlob,omitempty"`
// AzureLogAnalytics defines AzureLogAnalytics Output Configuration
Expand Down Expand Up @@ -142,6 +146,9 @@ func (list ClusterOutputList) Load(sl plugins.SecretLoader) (string, error) {
if item.Spec.Match != "" {
buf.WriteString(fmt.Sprintf(" Match %s\n", item.Spec.Match))
}
if item.Spec.LogLevel != "" {
buf.WriteString(fmt.Sprintf(" Log_Level %s\n", item.Spec.LogLevel))
}
if item.Spec.MatchRegex != "" {
buf.WriteString(fmt.Sprintf(" Match_Regex %s\n", item.Spec.MatchRegex))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,15 @@ spec:
type: object
type: object
type: array
logLevel:
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
match:
description: A pattern to match against the tags of incoming records.
It's case-sensitive and support the star (*) character as a wildcard.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ spec:
logLevel:
description: Diagnostic level (error/warning/info/debug/trace)
enum:
- "off"
- error
- warning
- info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ spec:
tag:
type: string
type: object
logLevel:
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
nodeExporterMetrics:
description: NodeExporterMetrics defines Node Exporter Metrics Input
configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,18 @@ spec:
will be used.
type: string
type: object
logLevel:
description: 'Set the plugin''s logging verbosity level. Allowed values
are: off, error, warn, info, debug and trace, Defaults to the SERVICE
section''s Log_Level'
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
loki:
description: Loki defines Loki Output configuration.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,15 @@ spec:
type: object
type: object
type: array
logLevel:
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
match:
description: A pattern to match against the tags of incoming records.
It's case-sensitive and support the star (*) character as a wildcard.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,18 @@ spec:
will be used.
type: string
type: object
logLevel:
description: 'Set the plugin''s logging verbosity level. Allowed values
are: off, error, warn, info, debug and trace, Defaults to the SERVICE
section''s Log_Level'
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
loki:
description: Loki defines Loki Output configuration.
properties:
Expand Down
9 changes: 9 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusterfilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,15 @@ spec:
type: object
type: object
type: array
logLevel:
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
match:
description: A pattern to match against the tags of incoming records.
It's case-sensitive and support the star (*) character as a wildcard.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ spec:
logLevel:
description: Diagnostic level (error/warning/info/debug/trace)
enum:
- "off"
- error
- warning
- info
Expand Down
9 changes: 9 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ spec:
tag:
type: string
type: object
logLevel:
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
nodeExporterMetrics:
description: NodeExporterMetrics defines Node Exporter Metrics Input
configuration.
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,18 @@ spec:
will be used.
type: string
type: object
logLevel:
description: 'Set the plugin''s logging verbosity level. Allowed values
are: off, error, warn, info, debug and trace, Defaults to the SERVICE
section''s Log_Level'
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
loki:
description: Loki defines Loki Output configuration.
properties:
Expand Down
9 changes: 9 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_filters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,15 @@ spec:
type: object
type: object
type: array
logLevel:
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
match:
description: A pattern to match against the tags of incoming records.
It's case-sensitive and support the star (*) character as a wildcard.
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,18 @@ spec:
will be used.
type: string
type: object
logLevel:
description: 'Set the plugin''s logging verbosity level. Allowed values
are: off, error, warn, info, debug and trace, Defaults to the SERVICE
section''s Log_Level'
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
loki:
description: Loki defines Loki Output configuration.
properties:
Expand Down
52 changes: 52 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,15 @@ spec:
type: object
type: object
type: array
logLevel:
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
match:
description: A pattern to match against the tags of incoming records.
It's case-sensitive and support the star (*) character as a wildcard.
Expand Down Expand Up @@ -1440,6 +1449,7 @@ spec:
logLevel:
description: Diagnostic level (error/warning/info/debug/trace)
enum:
- "off"
- error
- warning
- info
Expand Down Expand Up @@ -1717,6 +1727,15 @@ spec:
tag:
type: string
type: object
logLevel:
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
nodeExporterMetrics:
description: NodeExporterMetrics defines Node Exporter Metrics Input
configuration.
Expand Down Expand Up @@ -3089,6 +3108,18 @@ spec:
will be used.
type: string
type: object
logLevel:
description: 'Set the plugin''s logging verbosity level. Allowed values
are: off, error, warn, info, debug and trace, Defaults to the SERVICE
section''s Log_Level'
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
loki:
description: Loki defines Loki Output configuration.
properties:
Expand Down Expand Up @@ -10227,6 +10258,15 @@ spec:
type: object
type: object
type: array
logLevel:
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
match:
description: A pattern to match against the tags of incoming records.
It's case-sensitive and support the star (*) character as a wildcard.
Expand Down Expand Up @@ -22350,6 +22390,18 @@ spec:
will be used.
type: string
type: object
logLevel:
description: 'Set the plugin''s logging verbosity level. Allowed values
are: off, error, warn, info, debug and trace, Defaults to the SERVICE
section''s Log_Level'
enum:
- "off"
- error
- warning
- info
- debug
- trace
type: string
loki:
description: Loki defines Loki Output configuration.
properties:
Expand Down
Loading

0 comments on commit a69991d

Please sign in to comment.