Skip to content

Commit

Permalink
feat: Added options desc for log levels
Browse files Browse the repository at this point in the history
  • Loading branch information
pluveto committed Feb 4, 2023
1 parent e8e9c79 commit 3952933
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cmd/flydav/app/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app

import (
"os"
"strings"

"github.com/natefinch/lumberjack"
"github.com/pluveto/flydav/cmd/flydav/conf"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3952933

Please sign in to comment.