Comments (5)
Well, why dont you pass a new object with the relevant fields to winston? Putting just your current js object could also trouble with elasticsearch mappings. Imagine an 'id' field, one time as string next as integer - indexing would fail. Anyhow, we could look into an option to clone objects (bad for performance) or check where objects are modified to switch it off.
from winston-logsene.
Well I personally do it everywhere, therefore my code cause no troubles, but we have a thousands of lines of code from past which we did not write. And after changing logging service, our application stars falling, which I personally think should not happen (services we used before do not change the object we are using).
Having option for just "not send any extra field" like "source" is good enough for us, we do not need it.
However I am just thinking - do you use "toJSON" method? Then all you need is to append things like "source" to object which is created by it, not before. Or do you have another approach?
from winston-logsene.
Looked into the code. There is a rewrite option in the constructor - a function that can create a new object.
Actually the only field, which is added is "source", so we can switch that off with an option "setSource: false". How does it sound to you? For moment I would not make it standard, as other user might like the feature that that the node module is added to the log.
from winston-logsene.
That sounds great, I agree with "not stantard yet" beacuse it can cause troubles for users which is already using it. However if I would be you, I would think about "deprecate" that in future and after some time switch it, because IMHO logger should not cause any potential modifications by default.
from winston-logsene.
Just published a new version 1.1.10, setSource: false
is default and the log event should not be modified (but could using the rewrite function in constructor ...)
The new option is in the Readme, so if somebody likes the old functionality, it can be added to the constructor.
from winston-logsene.
Related Issues (15)
- Add winston-logsene to winston Transports HOT 1
- Logs not shipped if the process is very short-lived HOT 6
- Does not send successfully unless I wait 30 seconds HOT 5
- Add instructions for EU instance HOT 5
- readme is out of date
- Update to work with Winston 3.x HOT 1
- Add a Native UI or Kibana 4 screenshot to README
- Major memory leak and crash because of "flat" dependency HOT 5
- Unhandled error when unreachable is causing crash HOT 5
- tags don't appear to be received properly HOT 9
- Add support for handlesExceptions option HOT 5
- Update/remove vulnerable packages from npm
- Can't log exception instances HOT 11
- Memory leak and process.exit issue HOT 9
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 winston-logsene.