Comments (6)
It could be used to send rotated logfiles to central server
from lumberjack.
My use case for a callback is to preserve the program version information that I log on program startup. If this information gets rotated away, then it becomes tricky to track code version. Hence upon callback, I would write the version information again to the new log file.
from lumberjack.
It's an interesting idea. I'm not really sure what other things people would want to do on rotation, though. I like that lumberjack has a very simple API right now, and I would like to try to keep it that way... but it's worth further thought.
from lumberjack.
Another use case can be to move the backups to a different directory, other than the directory where the actual log file is located.
The API can still be simple for the common use case, as today, but enable more advanced cases as mentioned in this thread.
Any plans to progress with this? Is it OK to contribute a PR? (although it seems there is already a related open PR).
from lumberjack.
I would like to use this to redirect stderr for panics etc. to the new log file. Something similar to what's already in this fork: https://github.com/svatantra/lumberjack
from lumberjack.
My use case is to setup some Prometheuse metrics on log rotate, this may usefull to count how many files(bytes, approximately) been logged.
from lumberjack.
Related Issues (20)
- unable to go get again HOT 1
- Anyway to add time-stamp to initial file name and NOT just rotated logs? HOT 1
- Any way to get the rotated file name? HOT 1
- zap-logger with lumberjack not working HOT 1
- After the log file is rotated, the inode information changes, resulting in the generation of zombie files HOT 2
- gzip: *.log.gz: not in gzip format HOT 2
- A
- Allow timestamps to be added after the original extension instead of before
- Fallback writer in case of error HOT 2
- save other files on a daily basis instead of log files
- [question] How lumberjack works when there is a shutdown ? HOT 1
- Optimization suggestions HOT 1
- Feature Request : Callback before log file deletion
- Time zone issue with log rotation
- `Write` after `Close` on Logger still works on Windows
- add a option to custom time format HOT 1
- Goroutine leak after closing Logger HOT 2
- Keep reserved space for backup on device
- lumberjack has chown permission error when using in systemd HOT 1
- Open Telemetry drops logs when renamed HOT 1
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 lumberjack.