add create log file
This commit is contained in:
@@ -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__
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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__
|
||||||
|
|||||||
Reference in New Issue
Block a user