fluent / fluent/fluent-logger-node

Logging for all transport stop if fluent server is not available

Open
#115 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
258
Forks
82
PR merge metrics
No merged PRs in 30d

Description

In the case where the fluent server becomes unavailable the logging for all transports stop logging and not only the fluent one.

I was able to reproduce this with a slightly modified version of the `winston` example:

```
const winston = require('winston');
const fluentNodeLogger = require('fluent-logger');

const logger = winston.createLogger({
transports: [
new (fluentNodeLogger.support.winstonTransport())(
'___specialcustomtesttag',
{
host: 'localhost',
port: 24224,
timeout: 3.0
}
),
new winston.transports.Console({
format: winston.format.combine(
winston.format.colorize(),
winston.format.printf(info => `${info.level} ${new Date().toISOString()} ${info.message}`)
),
}),
],
});

(function repeatLog() {
setTimeout(() => {
logger.info('it works');
repeatLog();
}, 1000)
})();
```

Running this without any fluent listening on port 24224 will cause even the console log to stop after 16 loop.

If a fluent server is listening (or emulated with ` nc -lv 24224`) it keeps on going till I stop the fluent server and then it keep on logging on the console for 16 loops and then stops logging. Restarting the fluent server does not make the logging (console and fluent) start again.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the modified winston example with no fluent server, then repeat it with a server and stop that server to reproduce the transport failure. Trace the winston transport integration and verify that the console transport continues logging and that logging resumes after the fluent server is restarted.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.