Skip to content

Commit

Permalink
Merge pull request #33 from mdegat01/all-log-levels
Browse files Browse the repository at this point in the history
Support all log levels
  • Loading branch information
mdegat01 authored Apr 7, 2021
2 parents f8d17a2 + fd6cc36 commit 2428e6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion loki/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"cafile": "str?",
"days_to_keep": "int(2,)?",
"config_path": "str?",
"log_level": "list(debug|info|warning|error)?"
"log_level": "list(trace|debug|info|notice|warning|error|fatal)?"
}
}
11 changes: 7 additions & 4 deletions loki/rootfs/etc/services.d/loki/run
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ bashio::log.info "Retention period set to ${retention_period}"
export "RETENTION_PERIOD=${retention_period}"

case "$(bashio::config 'log_level')" in \
error) log_level='error' ;; \
warning) log_level='warn' ;; \
debug) log_level='debug' ;; \
*) log_level='info' ;; \
trace) ;& \
debug) log_level='debug' ;; \
notice) ;& \
warning) log_level='warn' ;; \
error) ;& \
fatal) log_level='error' ;; \
*) log_level='info' ;; \
esac;
bashio::log.info "Loki log level set to ${log_level}"

Expand Down

0 comments on commit 2428e6e

Please sign in to comment.