Giter Site home page Giter Site logo

Comments (4)

brihogan avatar brihogan commented on September 23, 2024

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.

indexzero avatar indexzero commented on September 23, 2024

Not really sure. I don't actively use this module in production, but I know others do. @yosefd?

from winston-mongodb.

yosefd avatar yosefd commented on September 23, 2024

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.

yurijmikhalevich avatar yurijmikhalevich commented on September 23, 2024

There is no spaces for me, too.

from winston-mongodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.