mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-04 18:33:36 +02:00
Fix loading log configs from local files and secret managers
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
### Fix
|
||||||
|
- Fix loading log configs from local files and secret managers.
|
||||||
|
|
||||||
## [3.26.0] - 2024-09-16
|
## [3.26.0] - 2024-09-16
|
||||||
# Add
|
# Add
|
||||||
- Add `imgproxy.source_image_url` and `imgproxy.processing_options` attributes to New Relic, DataDog, and OpenTelemetry traces.
|
- Add `imgproxy.source_image_url` and `imgproxy.processing_options` attributes to New Relic, DataDog, and OpenTelemetry traces.
|
||||||
|
@@ -9,6 +9,13 @@ import (
|
|||||||
"github.com/imgproxy/imgproxy/v3/config/configurators"
|
"github.com/imgproxy/imgproxy/v3/config/configurators"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Configure logrus so it can be used before Init().
|
||||||
|
// Structured formatter is a compromise between JSON and pretty formatters.
|
||||||
|
logrus.SetOutput(os.Stdout)
|
||||||
|
logrus.SetFormatter(&structuredFormatter{})
|
||||||
|
}
|
||||||
|
|
||||||
func Init() error {
|
func Init() error {
|
||||||
logrus.SetOutput(os.Stdout)
|
logrus.SetOutput(os.Stdout)
|
||||||
|
|
||||||
|
8
main.go
8
main.go
@@ -28,6 +28,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func initialize() error {
|
func initialize() error {
|
||||||
|
if err := loadenv.Load(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if err := logger.Init(); err != nil {
|
if err := logger.Init(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -36,10 +40,6 @@ func initialize() error {
|
|||||||
|
|
||||||
maxprocs.Set(maxprocs.Logger(log.Debugf))
|
maxprocs.Set(maxprocs.Logger(log.Debugf))
|
||||||
|
|
||||||
if err := loadenv.Load(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := config.Configure(); err != nil {
|
if err := config.Configure(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user