diff --git a/README.md b/README.md index 494634a..d5c1a76 100644 --- a/README.md +++ b/README.md @@ -29,18 +29,20 @@ A webdav application written in Go. - `password_hash`: The hashed password of the user. - `password_crypt`: The type of hashing algorithm used to hash the password. This should be set to “bcrypt”. - `[log]`: This section will define the logging settings for the webdav server. - - `level`: The log level of the server. + - `level`: The log level of the server. This can be set to “debug”, “info”, “warn”, “error”, or “fatal”. - `[[log.file]]`: This subsection will define the settings for the log file. Ignore this subsection if you do not want to log to a file. - - `format`: The format of the log file. + - `format`: The format of the log file. This can be set to “json” or “text”. - `path`: The path of the log file. - `max_size`: The maximum size of the log file in megabytes. - `max_age`: The maximum age of the log file in days. - `[[log.stdout]]`: This subsection will define the settings for the log output to the console. Ignore this subsection if you do not want to log to the console. - - `format`: The format of the log output. - - `output`: The output stream for the log output. + - `format`: The format of the log output. This can be set to “json” or “text”. + - `output`: The output stream for the log output. This can be set to “stdout” or “stderr”. 4. Save the configuration file and run the FlyDav server. You should now be able to access the webdav server with the configured settings. +To get a example configuration file, go to [conf dir](https://github.com/pluveto/flydav/blob/main/conf). + ## Features - [x] Basic authentication diff --git a/cmd/flydav/app/logger.go b/cmd/flydav/app/logger.go index 68be898..3f40a2d 100644 --- a/cmd/flydav/app/logger.go +++ b/cmd/flydav/app/logger.go @@ -2,6 +2,7 @@ package app import ( "os" + "strings" "github.com/natefinch/lumberjack" "github.com/pluveto/flydav/cmd/flydav/conf" @@ -70,6 +71,7 @@ func InitLogger(cnf conf.Log, verbose bool) { // levelToLogrusLevel converts a string to a logrus.Level func levelToLogrusLevel(level string) logrus.Level { + level = strings.ToLower(level) switch level { case "debug": return logrus.DebugLevel