winston-logstash | A Logstash TCP transport for winston | TCP library
kandi X-RAY | winston-logstash Summary
kandi X-RAY | winston-logstash Summary
A Logstash TCP transport for winston.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of winston-logstash
winston-logstash Key Features
winston-logstash Examples and Code Snippets
Community Discussions
Trending Discussions on winston-logstash
QUESTION
I'm trying to integrate a dummy nodejs app to an ELK stack. I'm using winston as logging library since it's my preferred choice when I develop on a JS stack. I've tried to write this sinppet of code, using winston 3.x version
...ANSWER
Answered 2019-Jul-07 at 03:36There are two concepts at play here, in Winston 3.
A format just does some transformations on the object you're logging.
A transport is a "pipe" that defines a way of taking your log object and sending it somewhere.
In the Winston 2 world, these two concepts were often combined; for instance, the winston-logstash
module was a transport but also implicitly formatted objects in a way that's acceptable for Logstash. There's nothing in Winston 2 or 3 that restricts what is possible in terms of transports or formats, so Winston 3 is not "missing support" for Logstash.
However, Winston 3 did make some changes to the transport API (and also separated out formats, as mentioned - though a transport can still do formatting). That is why you see warnings about winston-logstash
being a legacy transport: the authors of winston-logstash
have not updated their module to use the new Winston 3 style interfaces. There is a thread on the Winston project with some helpful info for transport authors on updating their transports.
So, you could bug the authors to upgrade their transport, upgrade/wrap it yourself (see linked thread), or - I think the legacy
warning is just a warning, so it should still work ok with Winston 3.
In fact, I think there is already a PR open to make winston-logstash
3.x compatible, though the repo maintainer seems to have ghosted; I suppose you could try using the PR branch/fork. You might also try winston-logstash-transport which appears to achieve the same goals but appears to be designed for 3.x. Feel free to comment on what works best.
QUESTION
I added the winston-logstash
package, which is a winston transport for logstash. Unfortunately it comes without typescript definitions and I am struggling with adding my own typings to it.
What I have tried:
My winston.ts:
...ANSWER
Answered 2018-Feb-21 at 20:51When you augment the winston Transports
interface, you need to surround it with module "winston" { ... }
This seemed to work:
QUESTION
I have the following setup in docker-compose.yml
:
ANSWER
Answered 2018-May-25 at 05:08Docker compose does not wait until a container is ready, it will only wait until it's running.
depends_on
will only ensure that logstash
launches before your node container, but again, this doesn't mean it will wait until it is ready.
You can either handle the checks yourself on node, or use a wrapper script. In docker-compose documentation, they recommend, wait-for-it or dockerize
You can read more on this in here
Custom wrapperYour node container command
can change from node index.js
(or whatever you have), to bash wait-for-logtash.sh
:
QUESTION
I've been using winston to push logs to logmatic for almost a year, and this week I had to turn it off because I get random connection errors which crash the production server. I turned it off as a temporal fix, but I would prefer something like a try/catch, which I tried but didn't work.
Here's my current code:
...ANSWER
Answered 2017-Sep-22 at 22:06You could do
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install winston-logstash
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page