add create log file

This commit is contained in:
2026-03-11 20:35:23 +07:00
parent a39e68cabc
commit 2dd3542ff9
3 changed files with 13 additions and 0 deletions

View File

@@ -270,6 +270,12 @@ end
# Main loop: runs indefinitely every CHECK_INTERVAL_SECS # Main loop: runs indefinitely every CHECK_INTERVAL_SECS
function main_loop() function main_loop()
# Ensure log file exists
if !isfile(LogFilePath)
open(LogFilePath, "a") do io
# create empty file
end
end
# limit log file to latest 100 events # limit log file to latest 100 events
limitTextFileLines(LogFilePath; maxlines=100) limitTextFileLines(LogFilePath; maxlines=100)
thisFilePath = @__FILE__ thisFilePath = @__FILE__

View File

@@ -22,3 +22,4 @@
[2026-03-11T16:27:47.181] Starting check loop. Checking router 192.168.88.1 every 60 seconds. [2026-03-11T16:27:47.181] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
[2026-03-11T16:30:28.572] Starting check loop. Checking router 192.168.88.1 every 60 seconds. [2026-03-11T16:30:28.572] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
[2026-03-11T16:43:50.213] Starting check loop. Checking router 192.168.88.1 every 60 seconds. [2026-03-11T16:43:50.213] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
[2026-03-11T17:37:15.954] Starting check loop. Checking router 192.168.88.1 every 60 seconds.

View File

@@ -257,6 +257,12 @@ end
# Main loop: runs indefinitely every CHECK_INTERVAL_SECS # Main loop: runs indefinitely every CHECK_INTERVAL_SECS
function main_loop() function main_loop()
# Ensure log file exists
if !isfile(LogFilePath)
open(LogFilePath, "a") do io
# create empty file
end
end
# limit log file to latest 100 events # limit log file to latest 100 events
limitTextFileLines(LogFilePath; maxlines=100) limitTextFileLines(LogFilePath; maxlines=100)
thisFilePath = @__FILE__ thisFilePath = @__FILE__