Updated log rotate and viewer design

- Moved log rotation flags to in-system settings
- New log tab for log related configs in util page
- Added line number limit in log view
- Fixed bug for using zip for .gz log compression
- Fixed panic for loading legacy log formats
This commit is contained in:
Toby Chui
2025-10-29 21:47:48 +08:00
parent 7829e5a321
commit 5dc89b812d
9 changed files with 499 additions and 60 deletions

View File

@@ -76,6 +76,7 @@ const (
CONF_PATH_RULE = CONF_FOLDER + "/rules/pathrules"
CONF_PLUGIN_GROUPS = CONF_FOLDER + "/plugin_groups.json"
CONF_GEODB_PATH = CONF_FOLDER + "/geodb"
CONF_LOG_CONFIG = CONF_FOLDER + "/log_conf.json"
)
/* System Startup Flags */
@@ -95,9 +96,9 @@ var (
enableAutoUpdate = flag.Bool("cfgupgrade", true, "Enable auto config upgrade if breaking change is detected")
/* Logging Configuration Flags */
enableLog = flag.Bool("enablelog", true, "Enable system wide logging, set to false for writing log to STDOUT only")
enableLogCompression = flag.Bool("enablelogcompress", true, "Enable log compression for rotated log files")
logRotate = flag.String("logrotate", "0", "Enable log rotation and set the maximum log file size in KB, also support K, M, G suffix (e.g. 200M), set to 0 to disable")
enableLog = flag.Bool("enablelog", true, "Enable system wide logging, set to false for writing log to STDOUT only")
//enableLogCompression = flag.Bool("enablelogcompress", true, "Enable log compression for rotated log files")
//logRotate = flag.String("logrotate", "0", "Enable log rotation and set the maximum log file size in KB, also support K, M, G suffix (e.g. 200M), set to 0 to disable")
/* Default Configuration Flags */
defaultInboundPort = flag.Int("default_inbound_port", 443, "Default web server listening port")