Skip to content

Commit

Permalink
refactor(configs): define logs folder rather than log file into configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeamon committed Nov 11, 2023
1 parent 3c5cff8 commit 1c99df8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions config.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# These below settings will be loaded into the
# App container environement. Update them based
# program during startup. Also into the App
# container environement. Update them based
# on your needs. Check the `docker-compose.yml`

# Delete them if you do not need those settings.
Expand All @@ -10,6 +11,6 @@
# environment variables in case your run the App
# in your local machine.

DRAP_REDIS_HOST="db.demo.redis"
DRAP_REDIS_HOST="192.168.253.128"
DRAP_REDIS_PORT=6379
DRAP_REDIS_PASSWORD="<secret>"
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Config struct {
BuildTime string `yaml:"build_time" envconfig:"DRAP_BUILD_TIME"`
IsProduction bool `yaml:"is_production" envconfig:"DRAP_IS_PRODUCTION"`
LogLevel zapcore.Level `yaml:"log_level" envconfig:"DRAP_LOG_LEVEL"`
LogFile string `yaml:"log_file" envconfig:"DRAP_LOG_FILE"`
LogFolder string `yaml:"log_folder" envconfig:"DRAP_LOG_FOLDER"`
ProfilerEndpointsEnable bool `yaml:"profiler_endpoints_enable" envconfig:"DRAP_PROFILER_ENDPOINTS_ENABLE"`
OpsEndpointsEnable bool `yaml:"ops_endpoints_enable" envconfig:"DRAP_OPS_ENDPOINTS_ENABLE"`
Server ServerConfig `yaml:"server"`
Expand Down
6 changes: 4 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# logs is printed on console and file
is_production: false
log_level: "info"
log_file: "logs/logs.log"
log_folder: "logs/"

# Could be manually set or envs variables
# or auto detected with build flags.
Expand All @@ -29,8 +29,10 @@ server:
host: "0.0.0.0"
port: "8080"
read_timeout: 5s
# write_timeout > request_timeout to allow
# timeout message to be sent.
write_timeout: 17s
request_timeout: 15s
request_timeout: 15s
shutdown_timeout: 90s
certs_file: "./server.crt"
key_file: "./server.key"
Expand Down

0 comments on commit 1c99df8

Please sign in to comment.