Comments (4)
Upon a quick inspection of your code I don't see where the spaces could be added, so I wonder if it's an issue with the mongodb driver or something in my system? It's just strange that it's adding it to message but nothing else.
from winston-mongodb.
Not really sure. I don't actively use this module in production, but I know others do. @yosefd?
from winston-mongodb.
I doesn't come from mongodb transport module. Spaces might be created somewhere in Winston upon formatting. I remember I once saw the code that pads additional spaces to align messages given different length of error level title (e..g. "info" vs "error").
In a way I use winston and this transport, I don't experience such problem. This what I do:
var mongotransport = new winston.transports.MongoDB({
host: cfg.host,
port: cfg.port,
collection: cfg.collection,
db: cfg.database,
handleExceptions: true,
level: options.level.remote
});
var logger = new winston.Logger({
transports: [
...other transports here...,
mongotransport
]
});
logger.padLevels = false; // do not pad levels
Setting padLevels to false should solve this.
from winston-mongodb.
There is no spaces for me, too.
from winston-mongodb.
Related Issues (20)
- winston.transports.MongoDB pushes empty root path "/" HOT 3
- How to set the db name? HOT 6
- Stop deprecation of pre-connected DB object HOT 9
- Update repo link in npm HOT 1
- Deprecation warning { useUnifiedTopology: true } when using mongoose v>6.x HOT 5
- Authentication error when passing the database HOT 4
- Load balancer mode requires driver version 4+ HOT 14
- TypeError: value.getLowBits is not a function HOT 5
- No overload matches this call
- can you tell me how to add new property . or expireAfterSeconds HOT 2
- after pushing logs to mongoDB script keeps running and is not ending HOT 5
- winston-transport this.once in the code causes app to crash. HOT 2
- How to add custom field?
- NodeJS 20 Deprecation Warning DEP0170 HOT 11
- [Feature Request]: Make CI work HOT 6
- Ignoring level HOT 4
- [Bug]: can't format timestamp using `winston.format.timestamp` HOT 1
- [Bug]: Code snippet hangs up when logging to MongoDB. HOT 2
- [Bug]: Cannot find package "mongodb-extjson" HOT 2
- [Bug]: ObjectId in meta transformed to empty object HOT 7
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-mongodb.