Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
efd6331
consolidate log config in activitylog
dragonchaser Jan 7, 2026
4883496
move log configure function to global log package
dragonchaser Jan 7, 2026
2229fb3
consolidate log config in antivirus
dragonchaser Jan 8, 2026
36b5988
consolidate log config in app-provider
dragonchaser Jan 8, 2026
234c9bf
consolidate log config in app-registry
dragonchaser Jan 8, 2026
587e3c7
consolidate log config in audit
dragonchaser Jan 8, 2026
b3e448b
consolidate log config in auth-app
dragonchaser Jan 8, 2026
99ff445
consolidate log config in auth-basic
dragonchaser Jan 8, 2026
ea415ab
consolidate log config in auth-bearer
dragonchaser Jan 8, 2026
fb5d5b7
consolidate log config in auth-machine
dragonchaser Jan 8, 2026
a5c8ec5
consolidate log config in auth-service
dragonchaser Jan 8, 2026
8a99312
consolidate log config in clientlog
dragonchaser Jan 8, 2026
e41f6c3
consolidate log config in collaboration
dragonchaser Jan 8, 2026
8541da3
consolidate log config in eventhistory
dragonchaser Jan 8, 2026
1c9ec51
consolidate log config in frontend
dragonchaser Jan 8, 2026
b13e65d
consolidate log config in gateway
dragonchaser Jan 8, 2026
95f0c06
consolidate log config in graph
dragonchaser Jan 8, 2026
8fe9444
consolidate log config in groups
dragonchaser Jan 8, 2026
b9124df
consolidate log config in idm
dragonchaser Jan 8, 2026
7f5a442
consolidate log config in idp
dragonchaser Jan 8, 2026
e0d126d
consolidate log config in invitations
dragonchaser Jan 8, 2026
9256296
consolidate log config in nats
dragonchaser Jan 8, 2026
bd586b7
consolidate log config in notifications
dragonchaser Jan 8, 2026
419edec
consolidate log config in ocm
dragonchaser Jan 8, 2026
d9423e2
consolidate log config in ocs
dragonchaser Jan 8, 2026
5c23253
consolidate log config in policies
dragonchaser Jan 8, 2026
86d4932
consolidate log config in postprocessing
dragonchaser Jan 8, 2026
21975d7
consolidate log config in proxy
dragonchaser Jan 8, 2026
f7caf63
consolidate log config in search
dragonchaser Jan 8, 2026
eadbb20
consolidate log config in settings
dragonchaser Jan 8, 2026
0569e20
consolidate log config in sharing
dragonchaser Jan 8, 2026
7f8023c
consolidate log config in sse
dragonchaser Jan 8, 2026
f5eacdc
consolidate log config in storage-publiclink
dragonchaser Jan 8, 2026
245a77a
consolidate log config in storage-shares
dragonchaser Jan 8, 2026
6c46867
consolidate log config in storage-system
dragonchaser Jan 8, 2026
9b3fde4
consolidate log config in storage-users
dragonchaser Jan 8, 2026
30c4fb2
consolidate log config in thumbnails
dragonchaser Jan 8, 2026
f696107
consolidate log config in userlog
dragonchaser Jan 8, 2026
dd34f40
consolidate log config in users
dragonchaser Jan 8, 2026
f039bcf
consolidate log config in web
dragonchaser Jan 8, 2026
36b90c8
consolidate log config in webdav
dragonchaser Jan 8, 2026
25952fc
consolidate log config in webfinger
dragonchaser Jan 8, 2026
cb9815a
fix yaml mappings
dragonchaser Jan 8, 2026
b51c4af
remove logger from proxytest
dragonchaser Jan 8, 2026
0bada42
fix typo in shared_types
dragonchaser Jan 8, 2026
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
14 changes: 14 additions & 0 deletions pkg/log/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package log

import "github.com/opencloud-eu/opencloud/pkg/shared"

// Configure initializes a service-specific logger instance.
func Configure(name string, commons *shared.Commons, localServiceLogLevel string) Logger {
return NewLogger(
Name(name),
Level(localServiceLogLevel),
Pretty(commons.Log.Pretty),
Color(commons.Log.Color),
File(commons.Log.File),
)
}
4 changes: 2 additions & 2 deletions services/activitylog/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"github.com/oklog/run"
"github.com/opencloud-eu/opencloud/pkg/log"
"github.com/opencloud-eu/reva/v2/pkg/events"
"github.com/opencloud-eu/reva/v2/pkg/events/stream"
"github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool"
Expand All @@ -22,7 +23,6 @@ import (
settingssvc "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0"
"github.com/opencloud-eu/opencloud/services/activitylog/pkg/config"
"github.com/opencloud-eu/opencloud/services/activitylog/pkg/config/parser"
"github.com/opencloud-eu/opencloud/services/activitylog/pkg/logging"
"github.com/opencloud-eu/opencloud/services/activitylog/pkg/metrics"
"github.com/opencloud-eu/opencloud/services/activitylog/pkg/server/debug"
"github.com/opencloud-eu/opencloud/services/activitylog/pkg/server/http"
Expand Down Expand Up @@ -55,7 +55,7 @@ func Server(cfg *config.Config) *cobra.Command {
return configlog.ReturnFatal(parser.ParseConfig(cfg))
},
RunE: func(cmd *cobra.Command, args []string) error {
logger := logging.Configure(cfg.Service.Name, cfg.Log)
logger := log.Configure(cfg.Service.Name, cfg.Commons, cfg.LogLevel)
tracerProvider, err := tracing.GetTraceProvider(cmd.Context(), cfg.Commons.TracesExporter, cfg.Service.Name)
if err != nil {
logger.Error().Err(err).Msg("Failed to initialize tracer")
Expand Down
3 changes: 2 additions & 1 deletion services/activitylog/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ type Config struct {

Service Service `yaml:"-"`

Log *Log `yaml:"log"`
LogLevel string `yaml:"loglevel" env:"OC_LOG_LEVEL;ACTIVITYLOG_LOG_LEVEL" desc:"The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'." introductionVersion:"1.0.0"`

Debug Debug `yaml:"debug"`

Events Events `yaml:"events"`
Expand Down
13 changes: 2 additions & 11 deletions services/activitylog/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,9 @@ func DefaultConfig() *config.Config {

// EnsureDefaults ensures the config contains default values
func EnsureDefaults(cfg *config.Config) {
// provide with defaults for shared logging, since we need a valid destination address for "envdecode".
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
cfg.Log = &config.Log{
Level: cfg.Commons.Log.Level,
Pretty: cfg.Commons.Log.Pretty,
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
if cfg.LogLevel == "" {
cfg.LogLevel = "error"
}

if cfg.GRPCClientTLS == nil && cfg.Commons != nil {
cfg.GRPCClientTLS = structs.CopyOrZeroValue(cfg.Commons.GRPCClientTLS)
}
Expand Down
9 changes: 0 additions & 9 deletions services/activitylog/pkg/config/log.go

This file was deleted.

17 changes: 0 additions & 17 deletions services/activitylog/pkg/logging/logging.go

This file was deleted.

8 changes: 1 addition & 7 deletions services/antivirus/pkg/command/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ func Health(cfg *config.Config) *cobra.Command {
return configlog.ReturnError(parser.ParseConfig(cfg))
},
RunE: func(cmd *cobra.Command, args []string) error {
logger := log.NewLogger(
log.Name(cfg.Service.Name),
log.Level(cfg.Log.Level),
log.Pretty(cfg.Log.Pretty),
log.Color(cfg.Log.Color),
log.File(cfg.Log.File),
)
logger := log.Configure(cfg.Service.Name, cfg.Commons, cfg.LogLevel)

resp, err := http.Get(
fmt.Sprintf(
Expand Down
9 changes: 1 addition & 8 deletions services/antivirus/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@ func Server(cfg *config.Config) *cobra.Command {
defer cancel()
}
ctx := cfg.Context

logger := log.NewLogger(
log.Name(cfg.Service.Name),
log.Level(cfg.Log.Level),
log.Pretty(cfg.Log.Pretty),
log.Color(cfg.Log.Color),
log.File(cfg.Log.File),
)
logger := log.Configure(cfg.Service.Name, cfg.Commons, cfg.LogLevel)

traceProvider, err := tracing.GetTraceProvider(cmd.Context(), cfg.Commons.TracesExporter, cfg.Service.Name)
if err != nil {
Expand Down
17 changes: 4 additions & 13 deletions services/antivirus/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ const (

// Config combines all available configuration parts.
type Config struct {
Commons *shared.Commons `yaml:"-"` // don't use this directly as configuration for a service
File string
Log *Log

Debug Debug `yaml:"debug" mask:"struct"`
Commons *shared.Commons `yaml:"-"` // don't use this directly as configuration for a service
File string
LogLevel string `yaml:"loglevel" env:"OC_LOG_LEVEL;ANTIVIRUS_LOG_LEVEL" desc:"The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'." introductionVersion:"1.0.0"`
Debug Debug `yaml:"debug" mask:"struct"`

Service Service `yaml:"-"`

Expand All @@ -55,14 +54,6 @@ type Service struct {
Name string `yaml:"-"`
}

// Log defines the available log configuration.
type Log struct {
Level string `mapstructure:"level" env:"OC_LOG_LEVEL;ANTIVIRUS_LOG_LEVEL" desc:"The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'." introductionVersion:"1.0.0"`
Pretty bool `mapstructure:"pretty" env:"OC_LOG_PRETTY;ANTIVIRUS_LOG_PRETTY" desc:"Activates pretty log output." introductionVersion:"1.0.0"`
Color bool `mapstructure:"color" env:"OC_LOG_COLOR;ANTIVIRUS_LOG_COLOR" desc:"Activates colorized log output." introductionVersion:"1.0.0"`
File string `mapstructure:"file" env:"OC_LOG_FILE;ANTIVIRUS_LOG_FILE" desc:"The path to the log file. Activates logging to this file if set." introductionVersion:"1.0.0"`
}

// Debug defines the available debug configuration.
type Debug struct {
Addr string `yaml:"addr" env:"ANTIVIRUS_DEBUG_ADDR" desc:"Bind address of the debug server, where metrics, health, config and debug endpoints will be exposed." introductionVersion:"1.0.0"`
Expand Down
4 changes: 2 additions & 2 deletions services/antivirus/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func DefaultConfig() *config.Config {

// EnsureDefaults adds default values to the configuration if they are not set yet
func EnsureDefaults(cfg *config.Config) {
if cfg.Log == nil {
cfg.Log = &config.Log{}
if cfg.LogLevel == "" {
cfg.LogLevel = "error"
}
}

Expand Down
4 changes: 2 additions & 2 deletions services/app-provider/pkg/command/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"net/http"

"github.com/opencloud-eu/opencloud/pkg/config/configlog"
"github.com/opencloud-eu/opencloud/pkg/log"
"github.com/opencloud-eu/opencloud/services/app-provider/pkg/config"
"github.com/opencloud-eu/opencloud/services/app-provider/pkg/config/parser"
"github.com/opencloud-eu/opencloud/services/app-provider/pkg/logging"
"github.com/spf13/cobra"
)

Expand All @@ -20,7 +20,7 @@ func Health(cfg *config.Config) *cobra.Command {
return configlog.ReturnError(parser.ParseConfig(cfg))
},
RunE: func(cmd *cobra.Command, args []string) error {
logger := logging.Configure(cfg.Service.Name, cfg.Log)
logger := log.Configure(cfg.Service.Name, cfg.Commons, cfg.LogLevel)

resp, err := http.Get(
fmt.Sprintf(
Expand Down
4 changes: 2 additions & 2 deletions services/app-provider/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os/signal"

"github.com/opencloud-eu/opencloud/pkg/log"
"github.com/opencloud-eu/reva/v2/cmd/revad/runtime"
"github.com/spf13/cobra"

Expand All @@ -15,7 +16,6 @@ import (
"github.com/opencloud-eu/opencloud/pkg/version"
"github.com/opencloud-eu/opencloud/services/app-provider/pkg/config"
"github.com/opencloud-eu/opencloud/services/app-provider/pkg/config/parser"
"github.com/opencloud-eu/opencloud/services/app-provider/pkg/logging"
"github.com/opencloud-eu/opencloud/services/app-provider/pkg/revaconfig"
"github.com/opencloud-eu/opencloud/services/app-provider/pkg/server/debug"
)
Expand All @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cobra.Command {
return configlog.ReturnFatal(parser.ParseConfig(cfg))
},
RunE: func(cmd *cobra.Command, args []string) error {
logger := logging.Configure(cfg.Service.Name, cfg.Log)
logger := log.Configure(cfg.Service.Name, cfg.Commons, cfg.LogLevel)
traceProvider, err := tracing.GetTraceProvider(cmd.Context(), cfg.Commons.TracesExporter, cfg.Service.Name)
if err != nil {
return err
Expand Down
15 changes: 4 additions & 11 deletions services/app-provider/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
)

type Config struct {
Commons *shared.Commons `yaml:"-"` // don't use this directly as configuration for a service
Service Service `yaml:"-"`
Log *Log `yaml:"log"`
Debug Debug `yaml:"debug"`
Commons *shared.Commons `yaml:"-"` // don't use this directly as configuration for a service
Service Service `yaml:"-"`
LogLevel string `yaml:"loglevel" env:"OC_LOG_LEVEL;APP_PROVIDER_LOG_LEVEL" desc:"The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'." introductionVersion:"1.0.0"`
Debug Debug `yaml:"debug"`

GRPC GRPCConfig `yaml:"grpc"`

Expand All @@ -24,13 +24,6 @@ type Config struct {
Context context.Context `yaml:"-"`
}

type Log struct {
Level string `yaml:"level" env:"OC_LOG_LEVEL;APP_PROVIDER_LOG_LEVEL" desc:"The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'." introductionVersion:"1.0.0"`
Pretty bool `yaml:"pretty" env:"OC_LOG_PRETTY;APP_PROVIDER_LOG_PRETTY" desc:"Activates pretty log output." introductionVersion:"1.0.0"`
Color bool `yaml:"color" env:"OC_LOG_COLOR;APP_PROVIDER_LOG_COLOR" desc:"Activates colorized log output." introductionVersion:"1.0.0"`
File string `yaml:"file" env:"OC_LOG_FILE;APP_PROVIDER_LOG_FILE" desc:"The path to the log file. Activates logging to this file if set." introductionVersion:"1.0.0"`
}

type Debug struct {
Addr string `yaml:"addr" env:"APP_PROVIDER_DEBUG_ADDR" desc:"Bind address of the debug server, where metrics, health, config and debug endpoints will be exposed." introductionVersion:"1.0.0"`
Token string `yaml:"token" env:"APP_PROVIDER_DEBUG_TOKEN" desc:"Token to secure the metrics endpoint" introductionVersion:"1.0.0"`
Expand Down
12 changes: 2 additions & 10 deletions services/app-provider/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,8 @@ func DefaultConfig() *config.Config {

// EnsureDefaults adds default values to the configuration if they are not set yet
func EnsureDefaults(cfg *config.Config) {
// provide with defaults for shared logging, since we need a valid destination address for "envdecode".
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
cfg.Log = &config.Log{
Level: cfg.Commons.Log.Level,
Pretty: cfg.Commons.Log.Pretty,
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
if cfg.LogLevel == "" {
cfg.LogLevel = "error"
}

if cfg.Reva == nil && cfg.Commons != nil {
Expand Down
17 changes: 0 additions & 17 deletions services/app-provider/pkg/logging/logging.go

This file was deleted.

5 changes: 3 additions & 2 deletions services/app-registry/pkg/command/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"net/http"

"github.com/opencloud-eu/opencloud/pkg/config/configlog"
"github.com/opencloud-eu/opencloud/pkg/log"
"github.com/opencloud-eu/opencloud/services/app-registry/pkg/config"
"github.com/opencloud-eu/opencloud/services/app-registry/pkg/config/parser"
"github.com/opencloud-eu/opencloud/services/app-registry/pkg/logging"

"github.com/spf13/cobra"
)

Expand All @@ -20,7 +21,7 @@ func Health(cfg *config.Config) *cobra.Command {
return configlog.ReturnError(parser.ParseConfig(cfg))
},
RunE: func(cmd *cobra.Command, args []string) error {
logger := logging.Configure(cfg.Service.Name, cfg.Log)
logger := log.Configure(cfg.Service.Name, cfg.Commons, cfg.LogLevel)

resp, err := http.Get(
fmt.Sprintf(
Expand Down
5 changes: 3 additions & 2 deletions services/app-registry/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ import (
"os/signal"

"github.com/opencloud-eu/opencloud/pkg/config/configlog"
"github.com/opencloud-eu/opencloud/pkg/log"
"github.com/opencloud-eu/opencloud/pkg/registry"
"github.com/opencloud-eu/opencloud/pkg/runner"
"github.com/opencloud-eu/opencloud/pkg/tracing"
"github.com/opencloud-eu/opencloud/pkg/version"
"github.com/opencloud-eu/opencloud/services/app-registry/pkg/config"
"github.com/opencloud-eu/opencloud/services/app-registry/pkg/config/parser"
"github.com/opencloud-eu/opencloud/services/app-registry/pkg/logging"
"github.com/opencloud-eu/opencloud/services/app-registry/pkg/revaconfig"
"github.com/opencloud-eu/opencloud/services/app-registry/pkg/server/debug"
"github.com/opencloud-eu/reva/v2/cmd/revad/runtime"

"github.com/spf13/cobra"
)

Expand All @@ -28,7 +29,7 @@ func Server(cfg *config.Config) *cobra.Command {
return configlog.ReturnFatal(parser.ParseConfig(cfg))
},
RunE: func(cmd *cobra.Command, args []string) error {
logger := logging.Configure(cfg.Service.Name, cfg.Log)
logger := log.Configure(cfg.Service.Name, cfg.Commons, cfg.LogLevel)
traceProvider, err := tracing.GetTraceProvider(cmd.Context(), cfg.Commons.TracesExporter, cfg.Service.Name)
if err != nil {
return err
Expand Down
14 changes: 4 additions & 10 deletions services/app-registry/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
type Config struct {
Commons *shared.Commons `yaml:"-"` // don't use this directly as configuration for a service

Service Service `yaml:"-"`
Log *Log `yaml:"log"`
Debug Debug `yaml:"debug"`
Service Service `yaml:"-"`
LogLevel string `yaml:"loglevel" env:"OC_LOG_LEVEL;APP_REGISTRY_LOG_LEVEL" desc:"The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'." introductionVersion:"1.0.0"`

Debug Debug `yaml:"debug"`

GRPC GRPCConfig `yaml:"grpc"`

Expand All @@ -23,13 +24,6 @@ type Config struct {
Context context.Context `yaml:"-"`
}

type Log struct {
Level string `yaml:"level" env:"OC_LOG_LEVEL;APP_REGISTRY_LOG_LEVEL" desc:"The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'." introductionVersion:"1.0.0"`
Pretty bool `yaml:"pretty" env:"OC_LOG_PRETTY;APP_REGISTRY_LOG_PRETTY" desc:"Activates pretty log output." introductionVersion:"1.0.0"`
Color bool `yaml:"color" env:"OC_LOG_COLOR;APP_REGISTRY_LOG_COLOR" desc:"Activates colorized log output." introductionVersion:"1.0.0"`
File string `yaml:"file" env:"OC_LOG_FILE;APP_REGISTRY_LOG_FILE" desc:"The path to the log file. Activates logging to this file if set." introductionVersion:"1.0.0"`
}

type Service struct {
Name string `yaml:"-"`
}
Expand Down
12 changes: 2 additions & 10 deletions services/app-registry/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,8 @@ func defaultMimeTypeConfig() []config.MimeTypeConfig {

// EnsureDefaults adds default values to the configuration if they are not set yet
func EnsureDefaults(cfg *config.Config) {
// provide with defaults for shared logging, since we need a valid destination address for "envdecode".
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
cfg.Log = &config.Log{
Level: cfg.Commons.Log.Level,
Pretty: cfg.Commons.Log.Pretty,
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
if cfg.LogLevel == "" {
cfg.LogLevel = "error"
}

if cfg.Reva == nil && cfg.Commons != nil {
Expand Down
17 changes: 0 additions & 17 deletions services/app-registry/pkg/logging/logging.go

This file was deleted.

Loading