Skip to content

[sdk-logs] remove deprecated LoggerProvider#addLogRecordProcessor() #5738

Closed
@pichlermarc

Description

@pichlermarc

Description

To align with the other SDKs (@opentelemetry/sdk-trace-*, @opentelemetry/sdk-metrics) we should drop LoggerProvider#addLogRecordProcessor() in favor of the constructor option introduced in #5588 (issue #5559)

This issue is considered done when:

  • the contrib and core repos have been checked any any usage of LoggerProvider#addLogRecordProcessor() has been changed to use the constructor option instead.
  • this method has been removed:
    • /**
      * @deprecated add your processors in the constructors instead.
      *
      * Adds a new {@link LogRecordProcessor} to this logger.
      * @param processor the new LogRecordProcessor to be added.
      */
      public addLogRecordProcessor(processor: LogRecordProcessor) {
      if (this._sharedState.registeredLogRecordProcessors.length === 0) {
      // since we might have enabled by default a batchProcessor, we disable it
      // before adding the new one
      this._sharedState.activeProcessor
      .shutdown()
      .catch(err =>
      diag.error(
      'Error while trying to shutdown current log record processor',
      err
      )
      );
      }
      this._sharedState.registeredLogRecordProcessors.push(processor);
      this._sharedState.activeProcessor = new MultiLogRecordProcessor(
      this._sharedState.registeredLogRecordProcessors,
      this._sharedState.forceFlushTimeoutMillis
      );
      }

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions