Skip to content
Snippets Groups Projects
Commit faff8983 authored by Steffen Schulze's avatar Steffen Schulze
Browse files

logging changed and dockerfile

parent 740cf4c6
No related branches found
No related tags found
1 merge request!10Refactoring
Pipeline #40602 passed with warnings with stages
in 2 minutes and 35 seconds
......@@ -22,7 +22,7 @@ WORKDIR /src
# copy lib from rust build
RUN mkdir -p didcomm/lib
COPY --from=rust-build /src/uniffi/target/release/libdidcomm_uniffi.* didcomm/lib/
COPY ./cmd/api/config.yaml /config.yaml
#RUN go build to build the application with the name app
RUN GOOS=linux GOARCH=amd64 go build -o /src/app ./cmd/api/
......
......@@ -69,19 +69,23 @@ var env string
func LoadConfig() error {
setDefaults()
Logger.Info("Read config")
readConfig()
if err := viper.Unmarshal(&CurrentConfiguration); err != nil {
return err
}
Logger.Info("Set ENV")
setEnvironment()
if err := checkMode(); err != nil {
return err
}
if err := setLogLevel(); err != nil {
return err
}
Logger.Info("Check Resolver")
err := checkResolver(CurrentConfiguration.DidComm.ResolverUrl)
if err != nil {
Logger.Error("Resolver not available", "msg", err)
......@@ -99,11 +103,6 @@ func LoadConfig() error {
b, err := json.Marshal(CurrentConfiguration)
if err != nil {
Logger.Error("Error marshalling config for logging", "config", err)
return err
}
Logger.Info(string(b))
if err != nil {
......@@ -167,6 +166,7 @@ func setEnvironment() {
}
func setLogLevel() (err error) {
Logger.Info("Set Log Level")
logLevel := new(slog.LevelVar)
switch strings.ToLower(CurrentConfiguration.LogLevel) {
case "debug":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment