Coder Social home page Coder Social logo

winston-redis's People

Contributors

chjj avatar crisfavero avatar dabh avatar dependabot[bot] avatar farenheith avatar indexzero avatar mgibeau avatar mooski avatar moretti avatar shaharke avatar tolgaakyuz avatar ttrfwork avatar wbt avatar yads avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

winston-redis's Issues

Unable to install winston-redis 3.1.0 with redis 3.1.2 (want 2.8.0)

When installing:

$ npm install winston-redis
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/redis
npm ERR!   redis@"^3.1.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer redis@"^2.8.0" from [email protected]
npm ERR! node_modules/winston-redis
npm ERR!   winston-redis@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

After removing redis, I saw the winston-redis package.json use older version of redis (2.8.0) :

{
  "name": "winston-redis",
  "description": "A fixed-length Redis transport for winston",
  "version": "3.1.0",
  "author": "Charlie Robbins <[email protected]>",
  "repository": {
    "type": "git",
    "url": "[email protected]:winstonjs/winston-redis.git"
  },
  "keywords": [
    "logging",
    "sysadmin",
    "tools",
    "winston",
    "redis"
  ],
  "dependencies": {
    "async": "^2.6.1",
    "lodash": "^4.6.1",
    "winston-transport": "^4.2.0"
  },
  "devDependencies": {
    "abstract-winston-transport": "^0.5.1",
    "mocha": "^5.2.0",
    "redis": "^2.8.0"
  },
  "peerDependencies": {
    "redis": "^2.8.0",
    "winston": "^3.0.0"
  },
  "main": "./lib/winston-redis",
  "scripts": {
    "test": "mocha test/*-test.js --exit"
  },
  "engines": {
    "node": ">=8.11.x"
  },
  "license": "MIT"
}

Meta data should be logged at the top level

Given this code:

logger.log({
    level: 'info',
    message: 'My message',
    additional: 'More stuff'
});

Other transports, such as File transport, log this JSON:

{"level":"info","message":"My message","additional":"More stuff"}

Whereas winston-redis logs this JSON:

{"level":"info","message":"My message","meta":{"additional":"More stuff"}}

Is it possible to add an option to log the meta data at the top level rather than as a child property?

Update redis to 0.8.1

Redis 0.8.1 removes the hiredis optional dependency, preventing it from failing to build on SmartOS and causing npm to report a failure. This fixes an issue on Nodejitsu, since we use SmartOS on Joyent. Thanks!

SyntaxError: Unexpected token ...

I'm running the beta version of this module and an bit older version of node
[email protected]
node v7.10.1

in line 84 of lib/winston-redis.js

https://github.com/winstonjs/winston-redis/blob/master/lib/winston-redis.js#L85

    const { level, message, ...winstonMeta } = info
    const meta = Object.assign({}, winstonMeta, this.metadata)

the ... operator is usually used with unpacking the values of an array or skipping over values during the deconstruction of an array.

maybe there's a different use of this operator that I don't know about in a newer version of js?

what's the intended behavior of these two lines?

full stack trace:

/path/node_modules/winston-redis/lib/winston-redis.js:84
    const { level, message, ...winstonMeta } = info
                            ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/path/utils/logger.js:2:1)

New release

@indexzero @chjj can you guys take a look at master and see about releasing this to npm? Any thoughts on versioning? It should be backwards compatible with v1.0, however, I've moved winston and redis into peerDependencies. So I'm not sure if that would be considered a breaking change.

Basic usage

Hi,

I'm trying to use winston with winston-redis. This is the first time I use winston. This is my code:

var winston = require('winston')
require('winston-redis')
winston.add(winston.transports.Redis)
winston.log('info', 'foo')

There is no error. But if I go to redis-cli and type "lrange winston 0 -1" this is the output

1) "undefined: undefined"

I'm using winston 0.5.3 and redis-winston 0.1.0

Thanks.

Node js versions

Hi,

After installing winston-redis via npm I'm receiving the following warning:

npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.11.x"} (current: {"node":"0.10.33","npm":"2.1.11"})

I know it's not a big issue but perhaps this needs updating. Version 0.8 of node was released nearly 2 years ago. Same issue with npm - some major updates have been included.

Error handling

Is there any support for error handling when a redis instance is not available? Currently the transport will just hang until it crashes. We want to use it as a transport in cases where the redis broker for messages is available and accepting messages, but not have the app crash if its unavailable or goes away while things are running. I can't really find a good solution of allowing this.

Multiple data types / channels support

It looks like the transport doesn't quite fit my requirements of pushing three (at this stage) types of data:

  1. text message
  2. integer message as a %
  3. integer message as a bug count

All of which will be sent on three different channels minimum at different times, in the form of:

{ id: update.timestamp, event: update.event, data: update.data }

which is consumed by subscribbers converting the messages into server sent events (SSE) (AKA EventSource) to be sent to a CLI somewhere on the internet.

Originally posted by @binarymist in #29 (comment)

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.