add env for log folder XUI_LOG_FOLDER

This commit is contained in:
Hamidreza Ghavami 2023-06-25 03:18:00 +04:30
parent 243aa8a5ae
commit 5b45b53696
No known key found for this signature in database
GPG key ID: 402C6797325182D9
2 changed files with 9 additions and 0 deletions

View file

@ -280,6 +280,7 @@ Reference syntax:
| XUI_DEBUG | `boolean` | `false` |
| XUI_BIN_FOLDER | `string` | `"bin"` |
| XUI_DB_FOLDER | `string` | `"/etc/x-ui"` |
| XUI_LOG_FOLDER | `string` | `"/var/log"` |
Example:

View file

@ -65,3 +65,11 @@ func GetDBFolderPath() string {
func GetDBPath() string {
return fmt.Sprintf("%s/%s.db", GetDBFolderPath(), GetName())
}
func GetLogFolder() string {
logFolderPath := os.Getenv("XUI_LOG_FOLDER")
if logFolderPath == "" {
logFolderPath = "/var/log"
}
return logFolderPath
}