Code Monkey home page Code Monkey logo

Comments (11)

EsOsO avatar EsOsO commented on August 22, 2024 2

I'm sorry guys, I'm busy at work so don't have much time to code. Hope to get back asap

from logging.

renehernandez avatar renehernandez commented on August 22, 2024 1

@tosoikea I didn't get to do any progress on this, so feel free to chime in

from logging.

EsOsO avatar EsOsO commented on August 22, 2024

Hi @renehernandez, I need to rework some logics before adding this request; right now I've tested some rolling function called every time a log is written but the performance are very bad.

Maybe I can think some sort of initializiation on the target, but in that way the roll will take place only the first time the script executes.
I will look into something, if you have any suggestion feel free to post it.

from logging.

renehernandez avatar renehernandez commented on August 22, 2024

Hi @EsOsO, I am interested in contributing to these feature. I went over the code, but couldn't find any rolling functionality here. Are you planning to share what you currently have? Otherwise, I could start developing some prototype as well for the rolling functionality by myself, but it would be wise to discuss some design upfront.

from logging.

EsOsO avatar EsOsO commented on August 22, 2024

I didn't push any change yet, still working local. Feel free to develop a patch to add this functionality.

The main problem I see here is about checking every call to the Write-Log function if the file needs to be rolled and to cleanup the older ones.

from logging.

EsOsO avatar EsOsO commented on August 22, 2024

I'm thinking about adding an Init scriptblock to the targets that gets executed once you Add-LoggingTarget. In this way we have an entry point to execute code only during Logging setup hence the ability to rotate log files and clean the containing folder.

from logging.

tosoikea avatar tosoikea commented on August 22, 2024

Any further thoughts or progress on implementing the log rotating?
If not I could have a look by the end of this week.

from logging.

allen-chin avatar allen-chin commented on August 22, 2024

Just want to double-check with everyone about the status of this issue. Would it be okay if I took a look to try something out?

from logging.

EsOsO avatar EsOsO commented on August 22, 2024

Sure, no problem, feel free to submit a PR

from logging.

tosoikea avatar tosoikea commented on August 22, 2024

@EsOsO As this thread seems to be falling asleep. I started work on it. I am implementing the following criterias for rotation

  1. RotateAfterAmount
    After a given threshold of files is exceeded, oldest first
  2. RotateAfterDate
    All files exceeding a certain difference between the current date and their creation time
  3. RotateAfterSize
    All files exceeding a certain size in bytes

The normal behaviour is going to be, that those files are discarded. However, there is also going to be an option to specify CompressRotated to put them into a .zip (or equivalent).

from logging.

tosoikea avatar tosoikea commented on August 22, 2024

@EsOsO I coded a first implementation on https://github.com/tosoikea/Logging/tree/rotation. Looking forward to your feedback. :)

from logging.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.