Logging lines
-
@akbooer said in Logging lines:
Ah, I believe that you're referring to this thread:
https://smarthome.community/topic/173/logging-and-rotation
In a word, no (said with much shame and embarrassment.)
I can refer you to this fix:
@akbooer said in Logging and rotation:
The openLuup/logs.lua file hasn't been updated since March, 2018. Although the infrastructure is there to selected file sizes, rotations, etc., at startup time, it's not used!
As a workaround, you can simply patch the numbers that you find at the start of that file (lines 47-50):
-- openLuup configuration options:
local Logfile = "logs/LuaUPnP.log" -- full path to log file
local LogfileLines = 2000 -- number of logfile lines before rotation
local LogfileVersions = 5 -- number of versions to retainI'll add that to the "must fix" list!
I, er, um, ..., seem to have lost that particular "must fix" list.
I'll start a new one immediately, and this is first on that list. I can't think what must have been distracting me since I made that post...
I hate to labour the point, but that fix that I tried? Further in that thread? (And still no reason to apologise, I was just checking that I didn't need to upgrade or do anything)
catman@openluup:/etc/cmh-ludl/logs$ cat LuaUPnP.log.1 | wc -l 2002
C
@catmanv2 said in Logging lines:
I hate to labour the point, but that fix that I tried?
Oh, yes, right you are. I seem to have lost the plot completely.
...but looking again at the original thread, I see:
@akbooer said in Logging and rotation:
All you need is a one-liner in the Lua Startup Code.
but you responded
OK, so reading the doc I've done this:
luup.attr_set ("openLuup.Logfile.Lines", 20000)
But I assume that's not going to persist.
Do I just do
attr ("openLuup.Logfile.Lines", "20000")
In the start up Lua window?
..and, in fact, I never followed up on that.
So I've just re-tried my original instruction, to add a one-line in the Startup Code (and save it, and reload.)
luup.attr_set ("openLuup.Logfile.Lines", 20000)
which does what I (and you) expect.
...so it was working all the time...
-
@catmanv2 said in Logging lines:
I hate to labour the point, but that fix that I tried?
Oh, yes, right you are. I seem to have lost the plot completely.
...but looking again at the original thread, I see:
@akbooer said in Logging and rotation:
All you need is a one-liner in the Lua Startup Code.
but you responded
OK, so reading the doc I've done this:
luup.attr_set ("openLuup.Logfile.Lines", 20000)
But I assume that's not going to persist.
Do I just do
attr ("openLuup.Logfile.Lines", "20000")
In the start up Lua window?
..and, in fact, I never followed up on that.
So I've just re-tried my original instruction, to add a one-line in the Startup Code (and save it, and reload.)
luup.attr_set ("openLuup.Logfile.Lines", 20000)
which does what I (and you) expect.
...so it was working all the time...
-
-
Note that you do have to do an explicit Luup reload after saving the Startup Lua... unlike Vera, it does not force an automatic reload (thus allowing you to make other changes before reloading.)
@akbooer said in Logging lines:
Note that you do have to do an explicit Luup reload after saving the Startup Lua... unlike Vera, it does not force an automatic reload (thus allowing you to make other changes before reloading.)
Cheers. It does say it does a reload, and I'm sure I did one, but I'm gonna double check.
Rotated at 1805 lines....
C
-
@akbooer said in Logging lines:
Note that you do have to do an explicit Luup reload after saving the Startup Lua... unlike Vera, it does not force an automatic reload (thus allowing you to make other changes before reloading.)
Cheers. It does say it does a reload, and I'm sure I did one, but I'm gonna double check.
Rotated at 1805 lines....
C
-
Pretty sure it's not having it. Forced reload. Log rotate at 1805 lines:
catman@openluup:/etc/cmh-ludl/logs$ cat LuaUPnP.log.1 | wc 1805 18112 264328
Entry in my Lua Startup
-- Add the log lines luup.attr_set ("openLuup.Logfile.Lines", 20000)
I assume I've done something stupid....
C
-
The parameters appears to reflect the actuality:
Logfile Incoming true Lines 2000 Name logs/LuaUPnP.log Versions 5
C
-
@catmanv2 said in Logging lines:
Can't see how to attach files in pm
You can email it to: openLuup at icloud.com
-
@catmanv2 said in Logging lines:
The parameters appears to reflect the actuality:
Then your Startup Code is wrong, or being changed somewhere else. You don’t have any residual edits left over from trying to fix this earlier?
@akbooer said in Logging lines:
@catmanv2 said in Logging lines:
The parameters appears to reflect the actuality:
Then your Startup Code is wrong, or being changed somewhere else. You don’t have any residual edits left over from trying to fix this earlier?
I don't think so. Can't see what else I would have done, or where I would have done it?
-- You can personalise the installation by changing these attributes, -- which are persistent and may be removed from the Startup after a reload. local attr = luup.attr_set ("latitude", 51.76) local attr = luup.attr_set ("City_description", Harlow) local attr = luup.attr_set ("longitude", 0.13) -- Geographical location attr ("City_description", "Harlow") attr ("Country_description", "UNITED KINGDOM") attr ("Region_description", "England") attr ("latitude", "51.76") attr ("longitude", "0.13") -- other parameters attr ("TemperatureFormat", "C") attr ("PK_AccessPoint", "88800000") attr ("currency", "£") attr ("date_format", "dd/mm/yy") attr ("model", "Not a Vera") attr ("timeFormat", "24hr") luup.attr_set ("openLuup.Logfile.Lines", 20000) -- Any other startup processing may be inserted here... luup.log "startup code completed"
Do I need to move the line to about the 'startup code completed?
C
-
This would rather explain it...
2020-12-08 22:41:12.859 openLuup.context_switch:: ERROR: [dev #0] [string "_openLuup_STARTUP_"]:9: attempt to call local 'attr' (a nil value) 2020-12-08 22:41:12.859 openLuup.init:: ERROR: [string "_openLuup_STARTUP_"]:9: attempt to call local 'attr' (a nil value)
You have a syntax error, and you’re not yet using the startup line I recommended.