(Last Updated: July 3, 2020)

Logging and rotation



  • Am I OK to alter the number of lines in the logs.lua file to increase the size of logs before rotation? I've got 71G of free SSD 0.1 days of run time is a trifle limiting 😄

    Cheers

    C



  • Yes, it was an arbitrary limit.

    All you need is a one-liner in the Lua Startup Code.



  • OK, that's something I've never done. I may be back.....

    C



  • This post is deleted!


  • @CatmanV2 said in Logging and rotation:

    OK, that's something I've never done. I may be back.....

    C

    Only to report what appears to be success. Also updated my long and lat and City 🙂

    C



  • OK not quite success. Although Openluup has reloaded and I see this in the conosle:
    Screenshot 2020-07-03 at 11.22.01.png

    LuaUpnp.log is still rotating after 2000 lines.

    What idiocy have I perpetrated now?

    Cheers

    C



  • This says 20,000. Is that what you set it to?



  • It was. About 10 times what the original value was (it was 2000)

    Currently 2000 is rotating every 20-30 minutes while I'm messing. Longest I had was 9 hours from 2200 last night to about 0700 this morning.

    Unless there's a really good reason I'd like about a day to a log....

    Cheers

    C



  • Well, interesting...

    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 retain
    

    I'll add that to the "must fix" list!

    Apologies,

    AK



  • Never a need to apologise!

    But you are going to hate me: my first attempt was....

    
    -- openLuup configuration options:
    local Logfile         = "logs/LuaUPnP.log"  -- full path to log file
    local LogfileLines    = 20000                -- number of logfile lines before rotation
    local LogfileVersions = 5                   -- number of versions to retain
    
    local StartupLogfile  = "logs/LuaUPnP_startup.log"
    
    --[[
    

    Which I have not reverted......

    C



  • You're saying that doesn't work?



  • I'm loathe to say it doesn't work as mostly It's luser error but I have (currently)
    local LogfileLines = 20000
    in my lua.logs file
    and what you see in the console above and my logs rotating quite frequently

    -rw-r--r-- 1 root root  23063 Jul  3 11:46 LuaUPnP_startup.log.5
    -rw-r--r-- 1 root root  23063 Jul  3 13:36 LuaUPnP_startup.log.4
    -rw-r--r-- 1 root root  23063 Jul  3 14:53 LuaUPnP_startup.log.3
    -rw-r--r-- 1 root root  23063 Jul  3 14:54 LuaUPnP_startup.log.2
    -rw-r--r-- 1 root root  77651 Jul  3 14:56 LuaUPnP.log.5
    -rw-r--r-- 1 root root  23063 Jul  3 14:56 LuaUPnP_startup.log.1
    -rw-r--r-- 1 root root  85688 Jul  3 14:59 LuaUPnP.log.4
    -rw-r--r-- 1 root root  23063 Jul  3 14:59 LuaUPnP_startup.log
    -rw-r--r-- 1 root root 280763 Jul  3 15:20 LuaUPnP.log.3
    -rw-r--r-- 1 root root 354596 Jul  3 16:50 LuaUPnP.log.2
    -rw-r--r-- 1 root root 356790 Jul  3 17:59 LuaUPnP.log.1
    -rw-r--r-- 1 root root  79932 Jul  3 18:07 LuaUPnP.log
    

    C



  • I can’t help noticing that the most recent ones are an order of magnitude larger than the earlier ones...?



  • @akbooer said in Logging and rotation:

    I can’t help noticing that the most recent ones are an order of magnitude larger than the earlier ones...?

    A fair shout, sir. However I made the changes rather earlier than those. I've been messing with some settings and you get a rotation each reload

    catman@openluup:/etc/cmh-ludl/logs$ ls -ltr
    total 1544
    -rw-r--r-- 1 root root  23063 Jul  3 11:46 LuaUPnP_startup.log.5
    -rw-r--r-- 1 root root  23063 Jul  3 13:36 LuaUPnP_startup.log.4
    -rw-r--r-- 1 root root  23063 Jul  3 14:53 LuaUPnP_startup.log.3
    -rw-r--r-- 1 root root  23063 Jul  3 14:54 LuaUPnP_startup.log.2
    -rw-r--r-- 1 root root  77651 Jul  3 14:56 LuaUPnP.log.5
    -rw-r--r-- 1 root root  23063 Jul  3 14:56 LuaUPnP_startup.log.1
    -rw-r--r-- 1 root root  85688 Jul  3 14:59 LuaUPnP.log.4
    -rw-r--r-- 1 root root  23063 Jul  3 14:59 LuaUPnP_startup.log
    -rw-r--r-- 1 root root 280763 Jul  3 15:20 LuaUPnP.log.3
    -rw-r--r-- 1 root root 354596 Jul  3 16:50 LuaUPnP.log.2
    -rw-r--r-- 1 root root 356790 Jul  3 17:59 LuaUPnP.log.1
    -rw-r--r-- 1 root root 257890 Jul  3 18:40 LuaUPnP.log
    

    and...

    catman@openluup:/etc/cmh-ludl/logs$ cat LuaUPnP.log.1 | wc -l
    2002
    

    Cheers

    C



  • @CatmanV2 said in Logging and rotation:

    and...

    ...I hate people with Unix skills. 😉



  • @akbooer said in Logging and rotation:

    @CatmanV2 said in Logging and rotation:

    and...

    ...I hate people with Unix skills. 😉

    Hah! How do you think I feel hanging around with people that understand code 😉

    Like a bloody drummer, that's what!

    C


Log in to reply