File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
content/en/docs/languages/python Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -406,20 +406,18 @@ log records that OpenTelemetry can process.
406406import logging
407407from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
408408from opentelemetry.sdk._logs.export import BatchLogRecordProcessor, ConsoleLogExporter
409- from opentelemetry._logs import set_logger_provider, get_logger
409+ from opentelemetry._logs import set_logger_provider
410410
411411provider = LoggerProvider()
412412processor = BatchLogRecordProcessor(ConsoleLogExporter())
413413provider.add_log_record_processor(processor)
414414# Sets the global default logger provider
415415set_logger_provider(provider)
416416
417- logger = get_logger(__name__ )
418-
419417handler = LoggingHandler(level = logging.INFO , logger_provider = provider)
420418logging.basicConfig(handlers = [handler], level = logging.INFO )
421419
422- logging.info(" This is an OpenTelemetry log record!" )
420+ logging.getLogger( __name__ ). info(" This is an OpenTelemetry log record!" )
423421```
424422
425423### Further Reading
You can’t perform that action at this time.
0 commit comments