Logging lines
-
Evening, all. Hope you're all well.
Did the logging line count / rotation challenge ever get sorted? I'm needing to look back at some historical events and my oldest log is barely 3 hours ago. (Not that I can recall how to try and change the line numbers etc)
Cheers!
C
-
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...
-
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...
@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
-
@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