feat: support customize http log format (#116)

This commit is contained in:
sigoden
2022-07-31 08:27:09 +08:00
committed by GitHub
parent 277d9d22d4
commit ae2f878e62
7 changed files with 255 additions and 27 deletions

View File

@@ -64,9 +64,10 @@ OPTIONS:
--render-index Serve index.html when requesting a directory, returns 404 if not found index.html
--render-try-index Serve index.html when requesting a directory, returns directory listing if not found index.html
--render-spa Serve SPA(Single Page Application)
--completions <shell> Print shell completion script for <shell> [possible values: bash, elvish, fish, powershell, zsh]
--tls-cert <path> Path to an SSL/TLS certificate to serve with HTTPS
--tls-key <path> Path to the SSL/TLS certificate's private key
--log-format <format> Customize http log format
--completions <shell> Print shell completion script for <shell> [possible values: bash, elvish, fish, powershell, zsh]
-h, --help Print help information
-V, --version Print version information
```
@@ -187,6 +188,23 @@ dufs -a /@admin:pass1@* -a /ui@designer:pass2 -A
- Account `admin:pass1` can upload/delete/view/download any files/folders.
- Account `designer:pass2` can upload/delete/view/download any files/folders in the `ui` folder.
## Log format
dufs supports customize http log format via option `--log-format`.
The default format is `$remote_addr "$request" $status`.
All variables list below:
| name | description |
| ------------ | ------------------------------------------------------------------------- |
| $remote_addr | client address |
| $remote_user | user name supplied with authentication |
| $request | full original request line |
| $status | response status |
| $http_ | arbitrary request header field. examples: $http_user_agent, $http_referer |
> use `dufs --log-format=''` to disable http log
## License
Copyright (c) 2022 dufs-developers.