|
| 1 | +; ======================= |
| 2 | +; j2/spdlog configuration file |
| 3 | +; ======================= |
| 4 | +; Reload Classification Guide |
| 5 | +; - [soft-load]: Immediately reflect without restarting (level/pattern/time/flush_on/periodic flush/disk monitoring ON/OFF, etc.) |
| 6 | +; - [hard-load]: requires sink regeneration (on/off, path, rotational capacity/number of backups) |
| 7 | +; - [init-only]: Read only from initialization (AUTO_RELOAD_SEC) |
| 8 | +; |
| 9 | +; HARD READ Beware |
| 10 | +; - Immediately switch to a new file (preserve existing files), pay attention to permissions/network paths when file paths change |
| 11 | +; - Reducing the number of rotations/backups does not immediately reduce files and will be applied from the next rotation |
| 12 | +; - 64 bits recommended for very large capacity (GB to TB), note file system limits and limits |
| 13 | + |
| 14 | +[Log] |
| 15 | + |
| 16 | +; ===== [init-only] Read only the first time ===== |
| 17 | +AUTO_RELOAD_SEC=60 |
| 18 | + |
| 19 | +; ===== [hard-load] sink needs to be regenerated ===== |
| 20 | +ENABLE_CONSOLE_LOG=true |
| 21 | +ENABLE_FILE_LOG_ALL=true |
| 22 | +ENABLE_FILE_LOG_ALERTS=true |
| 23 | + |
| 24 | +ALL_PATH=logs/all.log |
| 25 | +ALERTS_PATH=logs/alerts.log |
| 26 | + |
| 27 | +; a rotating policy |
| 28 | +; Example > General Log up to 500MB = 100MB * 5 |
| 29 | +ALL_MAX_SIZE=100MB |
| 30 | +ALL_MAX_FILES=5 |
| 31 | +; Example> Alert Log up to approximately 1 GB = 100 MB * 10 |
| 32 | +ALERT_MAX_SIZE=100MB |
| 33 | +ALERT_MAX_FILES=10 |
| 34 | + |
| 35 | +; ===== [soft-load] Immediate reflection ===== |
| 36 | +TIME_MODE=local |
| 37 | + |
| 38 | +; Minimum level (above) |
| 39 | +; trace, debug, info, alert, error, critical, off |
| 40 | + |
| 41 | +CONSOLE_LEVEL=trace |
| 42 | +; CONSOLE_LEVEL=critical |
| 43 | + |
| 44 | +ALL_FILE_LEVEL=trace |
| 45 | +ALERTS_FILE_LEVEL=warn |
| 46 | +LOGGER_LEVEL=trace |
| 47 | +FLUSH_ON_LEVEL=warn |
| 48 | + |
| 49 | +; Periodic flush in seconds |
| 50 | +FLUSH_EVERY_SEC=1 |
| 51 | + |
| 52 | +; Patterns |
| 53 | +; %Y %m %d %H %M %S %e = time |
| 54 | +; %l=Level %t=ThreadID %v=Message %^/%$=Color on/off |
| 55 | +PATTERN_CONSOLE=[%Y-%m-%d %H:%M:%S.%e] [%^%l%$] [%t] %v |
| 56 | +PATTERN_FILE=[%Y-%m-%d %H:%M:%S.%e] [%l] [%t] %v |
| 57 | + |
| 58 | +; ===== Disk Monitoring (single, soft-load) ===== |
| 59 | +; Disk Monitoring ON/OFF |
| 60 | +DISK_GUARD_ENABLE=false |
| 61 | +; Path on disk (or mount/drive) to be monitored, for example) /hello or C:\hello |
| 62 | +; DISK_ROOT=/hello |
| 63 | +DISK_ROOT=C:\ |
| 64 | +; Stop logging files if the remaining percentage (%) is below the threshold (only console output) |
| 65 | +DISK_MIN_FREE_RATIO=5 |
| 66 | +; Send UDP Notifications During File Logging Stopped |
| 67 | +UDP_ALERT_IP=127.0.0.1 |
| 68 | +UDP_ALERT_PORT=10514 |
| 69 | +UDP_ALERT_INTERVAL_SEC=60 |
| 70 | +; Placeholder: {path}={DISK_ROOT}, {avail_bytes}=Bytes, {ratio}=Residual percentage (%) |
| 71 | +UDP_ALERT_MESSAGE=DISK LOW: path={path} free={avail_bytes}B ({ratio}%) |
0 commit comments