Is it possible to have a seperate log file to monitor certain steps in the program.
Now you create an luup.log() message in to the log file.
If the file is getting to big it is overwritten by a new one,
so to look for certain step what happend a few ours ago is not possible
Do you make the file once and update it with a txt message
Do close it after adding
Where it is stored, or can you direct it to a ceftain location
How to make a time stamp
I have further changed the luup.log outputfunction:
In the start up function i have made the following section
local filelog = "/etc/cmh/AAxxx.log"
local outf = io.open(filelog, "a")
outf:write(os.date('%Y-%m-%d %H:%M:%S '.. "Relais: Start Up Completed "))
local filesize = outf:seek("end")
outf:write(filesize)
outf:write("\n")
outf:close()
if filesize > (25000) then
local filelog = "/etc/cmh/AAxxx.log"
local outf = io.open(filelog, "w+")
outf:write(os.date('%Y-%m-%d %H:%M:%S '.. "File Deleted and File renewed: Start Up Completed "))
outf:write("\n")
outf:close()
end
if the file is getting to big it is deleted and a new file is created
further the following function is made
function FileLog(Logtext)
local filelog = "/etc/cmh/AAxxx.log"
local outf = io.open(filelog, "a")
outf:write(os.date('%Y-%m-%d %H:%M:%S ' .. "Started = " .. Logtext .. " " ))
local filesize = outf:seek("end")
outf:write(filesize)
outf:write("\n")
outf:close()
end
further in the requested function the following instruction is entered
FileLog("tekst")
with this i can log the different steps as i want over a longer periode without being removed by the system
during the reboot it does not disapear
rgds
Huib
Best Home Automation shopping experience. Shop at Ezlo!