Vera deletes my custom log file? How to avoid this?

I am writing some audit/log entries to a custom log file, to keep separate from other Vera logging, and to retain the data longer. I am finding however that Vera seems to automatically delete the files I create. I have tried creating them both in the /tmp/log/cmh area, as well as on my /dataMine directory which is on a USB stick I put in.

Question: How/where can I put a custom log file I create such that it won’t be deleted by Vera?

Some notes:

local function gcLog(str) str = str or "" local file = io.open("/tmp/log/cmh/gc.log", "a") file:write( os.date("%x %X") .. " " .. str .. "\n") file:close() end gcLog("Testing 123")

Re details re when I write to /dataMine when I tested this, “mount” details for datamine:

/dev/sda1 on /dataMine type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

I create my custom log files in the /www folder. They don’t get deleted and can also be displayed from a browser using /filename.ext. I would also change the open mode to a+.

great advice Rex thanks, not only re location but also bonus of viewing it via browser

I didn’t realize there was an “a+” mode for write - perhaps this was the issue - it’s not quite clear to me the difference between “a” and “a+” then really?

I didn't realize there was an "a+" mode for write - perhaps this was the issue - it's not quite clear to me the difference between "a" and "a+" then really?

I agree - the difference is not obvious. I think the a+ mode is more important if you are reading and appending to the same file. I once found it fixed a problem so I’ve used it ever since. ;D