mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
fix(NA): MaxListenersExceededWarning on getLoggerStream (#57133)
* fix(NA): possible EventEmitter memory leak detected with a passthrough for getLoggerStream * chore(na): remove passthrough Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
ae78211408
commit
bc689d3534
1 changed files with 8 additions and 0 deletions
|
@ -24,6 +24,14 @@ import LogFormatJson from './log_format_json';
|
|||
import LogFormatString from './log_format_string';
|
||||
import { LogInterceptor } from './log_interceptor';
|
||||
|
||||
// NOTE: legacy logger creates a new stream for each new access
|
||||
// In https://github.com/elastic/kibana/pull/55937 we reach the max listeners
|
||||
// default limit of 10 for process.stdout which starts a long warning/error
|
||||
// thrown every time we start the server.
|
||||
// In order to keep using the legacy logger until we remove it I'm just adding
|
||||
// a new hard limit here.
|
||||
process.stdout.setMaxListeners(15);
|
||||
|
||||
export function getLoggerStream({ events, config }) {
|
||||
const squeeze = new Squeeze(events);
|
||||
const format = config.json ? new LogFormatJson(config) : new LogFormatString(config);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue