In my case, I create loggers for each module on init. Then as soon as remote logging endpoint auth is available I apply remote plugin. But the logs from loggers created before that moment are not being sent:
log.enableAll();
const loggerTwo = log.getLogger('module-two');
// ...
// auth is available, applying remote plugin:
remote.apply(log, options);
log.debug('this message will be sent to remote`);
loggerTwo.debug('this message will NOT be sent to remote`);
And there is no way to apply remote plugin to module-two logger separately:
remote.apply(log.getLogger('module-two'), options); // will fail
Since .apply() is expecting root logger and will throw: Argument is not a root loglevel object error.
In my case, I create loggers for each module on init. Then as soon as remote logging endpoint auth is available I apply
remote
plugin. But the logs from loggers created before that moment are not being sent:And there is no way to apply
remote
plugin tomodule-two
logger separately:Since
.apply()
is expecting root logger and will throw:Argument is not a root loglevel object
error.Any help is appreciated!