1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Log rotate plugin

Discussion in 'Help' started by XenialDan, Oct 4, 2018.

  1. XenialDan

    XenialDan Baby Zombie

    Messages:
    141
    GitHub:
    thebigsmilexd
    Would it be possible to create a log-rotation plugin that changes the log file when it exceededs a specific size or a time schedule?

    As i saw both the logger in the Server class and the logFile in the MainLogger class are private/protected, so it seems impossible to overwrite them whilest the server is running.

    Any workarounds that you might know?
     
    Last edited: Oct 4, 2018
  2. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    This is something we're planning to implement into the core in the future.
     
  3. XenialDan

    XenialDan Baby Zombie

    Messages:
    141
    GitHub:
    thebigsmilexd
    I see, good to know.

    Apart from it, is it save to change the content of the server.log file whilest the server is running? Or will it throw errors when accessed?
     
  4. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    Depends on the OS. On linux you can probably blow it away without any issues. On Windows you're likely to get trouble from it.
     
    jasonwynn10 and XenialDan like this.
  5. XenialDan

    XenialDan Baby Zombie

    Messages:
    141
    GitHub:
    thebigsmilexd
  6. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    1. It may have concurrency issues. This may cause data loss, because logger IO is threaded, and contents might be written into the log while you are slicing it.
    2. It may have memory issues. Have you stress-tested it with a 16-GB-large log file?
     
    XenialDan likes this.
  7. XenialDan

    XenialDan Baby Zombie

    Messages:
    141
    GitHub:
    thebigsmilexd
    30GB files seems to be handled ok. It is handled via tasks, except for the startup split option, so it might not create too big of an issue

    The first issue did not happen to me yet, but good idea, might take it into consideration, thanks for the hint.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.