Skip to content

Commit 3952933

Browse files
committed
feat: Added options desc for log levels
1 parent e8e9c79 commit 3952933

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@ A webdav application written in Go.
2929
- `password_hash`: The hashed password of the user.
3030
- `password_crypt`: The type of hashing algorithm used to hash the password. This should be set to “bcrypt”.
3131
- `[log]`: This section will define the logging settings for the webdav server.
32-
- `level`: The log level of the server.
32+
- `level`: The log level of the server. This can be set to “debug”, “info”, “warn”, “error”, or “fatal”.
3333
- `[[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.
34-
- `format`: The format of the log file.
34+
- `format`: The format of the log file. This can be set to “json” or “text”.
3535
- `path`: The path of the log file.
3636
- `max_size`: The maximum size of the log file in megabytes.
3737
- `max_age`: The maximum age of the log file in days.
3838
- `[[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.
39-
- `format`: The format of the log output.
40-
- `output`: The output stream for the log output.
39+
- `format`: The format of the log output. This can be set to “json” or “text”.
40+
- `output`: The output stream for the log output. This can be set to “stdout” or “stderr”.
4141

4242
4. Save the configuration file and run the FlyDav server. You should now be able to access the webdav server with the configured settings.
4343

44+
To get a example configuration file, go to [conf dir](https://github.com/pluveto/flydav/blob/main/conf).
45+
4446
## Features
4547

4648
- [x] Basic authentication

cmd/flydav/app/logger.go

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package app
22

33
import (
44
"os"
5+
"strings"
56

67
"github.com/natefinch/lumberjack"
78
"github.com/pluveto/flydav/cmd/flydav/conf"
@@ -70,6 +71,7 @@ func InitLogger(cnf conf.Log, verbose bool) {
7071

7172
// levelToLogrusLevel converts a string to a logrus.Level
7273
func levelToLogrusLevel(level string) logrus.Level {
74+
level = strings.ToLower(level)
7375
switch level {
7476
case "debug":
7577
return logrus.DebugLevel

0 commit comments

Comments
 (0)