Comments (11)
I'm sorry guys, I'm busy at work so don't have much time to code. Hope to get back asap
from logging.
@tosoikea I didn't get to do any progress on this, so feel free to chime in
from logging.
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.
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.
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.
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.
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.
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.
Sure, no problem, feel free to submit a PR
from logging.
@EsOsO As this thread seems to be falling asleep. I started work on it. I am implementing the following criterias for rotation
- RotateAfterAmount
After a given threshold of files is exceeded, oldest first - RotateAfterDate
All files exceeding a certain difference between the current date and their creation time - 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.
@EsOsO I coded a first implementation on https://github.com/tosoikea/Logging/tree/rotation. Looking forward to your feedback. :)
from logging.
Related Issues (20)
- AzureLogAnalytics target generates an error when no Body provided
- Create dev builds
- Build against Linux, MacOS, Windows / Windows Powershell, Powershell
- Are target names case sensitive? HOT 2
- Add variable hostname to $logMessage HOT 6
- Support for multiple Teams channels HOT 2
- File Target is converting $Log.body to json permanently HOT 1
- Not support Chinese? or any other Unicode language?
- Import-Module raises errors if in a script strict mode
- MS Teams Target: Proxy Support HOT 1
- Get-LoggingMessageCount.ps1 missing
- Wait-Logging Hanging Scheduled Task HOT 3
- Logging target mail: send Bulk Log
- Add support for PS transcript (Start-Transcript)
- Question: Support for colors in the format string
- Reset-LoggingTarget or -Scope param? HOT 6
- File Target with Relative Path HOT 4
- Most targets ignore -ExceptionInfo HOT 1
- SEQ: structured logging not implemented HOT 4
- NotifyBeginApplication/NotifyEndApplication calls not needed?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logging.