Comments (1)
Hm... An interesting usecase. Not one I'd considered going into this.
Currently, It's not something that can be done. I set it up to be an exact mapping between entry.Level
and a file, then later streams were added. If you want to write a PR you could probably do something similar to the introduction of streams.
If you wanted to add support for file routing by Fields
you would need the following:
- You'd have to add code to the
fileWrite
method that would allow using something other thanentry.Level
as the file selector. - You'd have to add a
Field
-Filename
map that would be set in the contructor. Similar to thePathMap
, and if you just create a different type likeFieldPathMap
then it could be supported without too much difficulty.
I don't see it as a super complex change, but you'd have to be really careful to not introduce regressions.
from lfshook.
Related Issues (20)
- Can you support the archive when the file get too big? HOT 3
- How to hide log from console? HOT 4
- go-file-rotatelogs exampled out of date HOT 1
- case-insensitive import
- build problem HOT 1
- In Example Log.Formatter is useless HOT 1
- Formatting broken for non-TextFormatter formatters (PR7 reverted) HOT 3
- Use of "v" in version tag to support gopkg.in HOT 3
- All tags point to the same commit HOT 2
- Can't create log files in JSON format HOT 4
- README need to be updated HOT 1
- A mistake HOT 2
- Failed to fire hook HOT 1
- Example HOT 1
- panic: runtime error: slice bounds out of range HOT 2
- Is it not efficient that open/close file each time while logrus fires hook writing? HOT 1
- New Trace log level in logrus HOT 1
- Change log file name dynamically HOT 1
- How often the files are closed? HOT 2
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 lfshook.