We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
error with logging instrumentation - AttributeError: 'ProxyTracerProvider' object has no attribute 'resource'
**Describe your environment** 

LoggingInstrumentor().instrument() is throwing an error
```
Traceback (most recent call last):
  File "manage.py", line 30, in <module>
    main()
  File "manage.py", line 14, in main
    LoggingInstrumentor().instrument(set_logging_format=True)
  File "/home/vamsikrishnam/otel/lib/python3.8/site-packages/opentelemetry/instrumentation/instrumentor.py", line 109, in instrument
    result = self._instrument(  # pylint: disable=assignment-from-no-return
  File "/home/vamsikrishnam/otel/lib/python3.8/site-packages/opentelemetry/instrumentation/logging/__init__.py", line 81, in _instrument
    resource = provider.resource if provider else None
AttributeError: 'ProxyTracerProvider' object has no attribute 'resource'
```

**Steps to reproduce**
Below packages installed and trying to instrument with below two lines:

>  LoggingInstrumentor().instrument(set_logging_format=True)
>  DjangoInstrumentor().instrument()

```
(otel) vamsikrishnam@NHHYDL-00217:~/django$ pip list | grep opentele
opentelemetry-api                      1.7.1
opentelemetry-exporter-otlp            1.7.1
opentelemetry-exporter-otlp-proto-grpc 1.7.1
opentelemetry-exporter-otlp-proto-http 1.7.1
opentelemetry-instrumentation          0.26b1
opentelemetry-instrumentation-django   0.26b1
opentelemetry-instrumentation-logging  0.26b1
opentelemetry-instrumentation-wsgi     0.26b1
opentelemetry-propagator-b3            1.7.1
opentelemetry-proto                    1.7.1
opentelemetry-sdk                      1.7.1
opentelemetry-semantic-conventions     0.26b1
opentelemetry-util-http                0.26b1
```

**What is the expected behavior?**
What did you expect to see?
logging should be instrumented properly.

**What is the actual behavior?**
What did you see instead?
logging should be instrumented properly and populate the otelTraceID and otelSpanID in the logs.

**Additional context**
Add any other context about the problem here.

$ python3 --version
Python 3.8.10

manage.py:

```
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
import logging
from opentelemetry.instrumentation.django import DjangoInstrumentor
from opentelemetry.instrumentation.logging import LoggingInstrumentor


def main():
    """Run administrative tasks."""
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_project.settings')
    logging.basicConfig(level = logging.DEBUG)
    LoggingInstrumentor().instrument(set_logging_format=True)
    DjangoInstrumentor().instrument()
    # LoggingInstrumentor().instrument(set_logging_format=True,log_level=logging.DEBUG)

    try:
        from django.core.management import execute_from_command_line
    except ImportError as exc:
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
        ) from exc
    execute_from_command_line(sys.argv)


if __name__ == '__main__':
    main()
```



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py`
Content:
```
1 # Copyright The OpenTelemetry Authors
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 # pylint: disable=empty-docstring,no-value-for-parameter,no-member,no-name-in-module
16 
17 import logging  # pylint: disable=import-self
18 from os import environ
19 from typing import Collection
20 
21 from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
22 from opentelemetry.instrumentation.logging.constants import (
23     _MODULE_DOC,
24     DEFAULT_LOGGING_FORMAT,
25 )
26 from opentelemetry.instrumentation.logging.environment_variables import (
27     OTEL_PYTHON_LOG_CORRELATION,
28     OTEL_PYTHON_LOG_FORMAT,
29     OTEL_PYTHON_LOG_LEVEL,
30 )
31 from opentelemetry.instrumentation.logging.package import _instruments
32 from opentelemetry.trace import (
33     INVALID_SPAN,
34     INVALID_SPAN_CONTEXT,
35     get_current_span,
36     get_tracer_provider,
37 )
38 
39 __doc__ = _MODULE_DOC
40 
41 LEVELS = {
42     "debug": logging.DEBUG,
43     "info": logging.INFO,
44     "warning": logging.WARNING,
45     "error": logging.ERROR,
46 }
47 
48 
49 class LoggingInstrumentor(BaseInstrumentor):  # pylint: disable=empty-docstring
50     __doc__ = f"""An instrumentor for stdlib logging module.
51 
52     This instrumentor injects tracing context into logging records and optionally sets the global logging format to the following:
53 
54     .. code-block::
55 
56         {DEFAULT_LOGGING_FORMAT}
57 
58     Args:
59         tracer_provider: Tracer provider instance that can be used to fetch a tracer.
60         set_logging_format: When set to True, it calls logging.basicConfig() and sets a logging format.
61         logging_format: Accepts a string and sets it as the logging format when set_logging_format
62             is set to True.
63         log_level: Accepts one of the following values and sets the logging level to it.
64             logging.INFO
65             logging.DEBUG
66             logging.WARN
67             logging.ERROR
68             logging.FATAL
69 
70     See `BaseInstrumentor`
71     """
72 
73     _old_factory = None
74 
75     def instrumentation_dependencies(self) -> Collection[str]:
76         return _instruments
77 
78     def _instrument(self, **kwargs):
79         service_name = ""
80         provider = kwargs.get("tracer_provider", None) or get_tracer_provider()
81         resource = provider.resource if provider else None
82         if resource:
83             service_name = resource.attributes.get("service.name")
84 
85         old_factory = logging.getLogRecordFactory()
86         LoggingInstrumentor._old_factory = old_factory
87 
88         def record_factory(*args, **kwargs):
89             record = old_factory(*args, **kwargs)
90 
91             record.otelSpanID = "0"
92             record.otelTraceID = "0"
93             record.otelServiceName = service_name
94 
95             span = get_current_span()
96             if span != INVALID_SPAN:
97                 ctx = span.get_span_context()
98                 if ctx != INVALID_SPAN_CONTEXT:
99                     record.otelSpanID = format(ctx.span_id, "016x")
100                     record.otelTraceID = format(ctx.trace_id, "032x")
101             return record
102 
103         logging.setLogRecordFactory(record_factory)
104 
105         set_logging_format = kwargs.get(
106             "set_logging_format",
107             environ.get(OTEL_PYTHON_LOG_CORRELATION, "false").lower()
108             == "true",
109         )
110 
111         if set_logging_format:
112             log_format = kwargs.get(
113                 "logging_format", environ.get(OTEL_PYTHON_LOG_FORMAT, None)
114             )
115             log_format = log_format or DEFAULT_LOGGING_FORMAT
116 
117             log_level = kwargs.get(
118                 "log_level", LEVELS.get(environ.get(OTEL_PYTHON_LOG_LEVEL))
119             )
120             log_level = log_level or logging.INFO
121 
122             logging.basicConfig(format=log_format, level=log_level)
123 
124     def _uninstrument(self, **kwargs):
125         if LoggingInstrumentor._old_factory:
126             logging.setLogRecordFactory(LoggingInstrumentor._old_factory)
127             LoggingInstrumentor._old_factory = None
128
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py
--- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py
@@ -76,20 +76,29 @@
         return _instruments
 
     def _instrument(self, **kwargs):
-        service_name = ""
-        provider = kwargs.get("tracer_provider", None) or get_tracer_provider()
-        resource = provider.resource if provider else None
-        if resource:
-            service_name = resource.attributes.get("service.name")
 
+        provider = kwargs.get("tracer_provider", None) or get_tracer_provider()
         old_factory = logging.getLogRecordFactory()
         LoggingInstrumentor._old_factory = old_factory
 
+        service_name = None
+
         def record_factory(*args, **kwargs):
             record = old_factory(*args, **kwargs)
 
             record.otelSpanID = "0"
             record.otelTraceID = "0"
+
+            nonlocal service_name
+            if service_name is None:
+                resource = getattr(provider, "resource", None)
+                if resource:
+                    service_name = (
+                        resource.attributes.get("service.name") or ""
+                    )
+                else:
+                    service_name = ""
+
             record.otelServiceName = service_name
 
             span = get_current_span()

{"golden_diff": "diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py\n--- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py\n+++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py\n@@ -76,20 +76,29 @@\n         return _instruments\n \n     def _instrument(self, **kwargs):\n-        service_name = \"\"\n-        provider = kwargs.get(\"tracer_provider\", None) or get_tracer_provider()\n-        resource = provider.resource if provider else None\n-        if resource:\n-            service_name = resource.attributes.get(\"service.name\")\n \n+        provider = kwargs.get(\"tracer_provider\", None) or get_tracer_provider()\n         old_factory = logging.getLogRecordFactory()\n         LoggingInstrumentor._old_factory = old_factory\n \n+        service_name = None\n+\n         def record_factory(*args, **kwargs):\n             record = old_factory(*args, **kwargs)\n \n             record.otelSpanID = \"0\"\n             record.otelTraceID = \"0\"\n+\n+            nonlocal service_name\n+            if service_name is None:\n+                resource = getattr(provider, \"resource\", None)\n+                if resource:\n+                    service_name = (\n+                        resource.attributes.get(\"service.name\") or \"\"\n+                    )\n+                else:\n+                    service_name = \"\"\n+\n             record.otelServiceName = service_name\n \n             span = get_current_span()\n", "issue": "error with logging instrumentation - AttributeError: 'ProxyTracerProvider' object has no attribute 'resource'\n**Describe your environment** \r\n\r\nLoggingInstrumentor().instrument() is throwing an error\r\n```\r\nTraceback (most recent call last):\r\n  File \"manage.py\", line 30, in <module>\r\n    main()\r\n  File \"manage.py\", line 14, in main\r\n    LoggingInstrumentor().instrument(set_logging_format=True)\r\n  File \"/home/vamsikrishnam/otel/lib/python3.8/site-packages/opentelemetry/instrumentation/instrumentor.py\", line 109, in instrument\r\n    result = self._instrument(  # pylint: disable=assignment-from-no-return\r\n  File \"/home/vamsikrishnam/otel/lib/python3.8/site-packages/opentelemetry/instrumentation/logging/__init__.py\", line 81, in _instrument\r\n    resource = provider.resource if provider else None\r\nAttributeError: 'ProxyTracerProvider' object has no attribute 'resource'\r\n```\r\n\r\n**Steps to reproduce**\r\nBelow packages installed and trying to instrument with below two lines:\r\n\r\n>  LoggingInstrumentor().instrument(set_logging_format=True)\r\n>  DjangoInstrumentor().instrument()\r\n\r\n```\r\n(otel) vamsikrishnam@NHHYDL-00217:~/django$ pip list | grep opentele\r\nopentelemetry-api                      1.7.1\r\nopentelemetry-exporter-otlp            1.7.1\r\nopentelemetry-exporter-otlp-proto-grpc 1.7.1\r\nopentelemetry-exporter-otlp-proto-http 1.7.1\r\nopentelemetry-instrumentation          0.26b1\r\nopentelemetry-instrumentation-django   0.26b1\r\nopentelemetry-instrumentation-logging  0.26b1\r\nopentelemetry-instrumentation-wsgi     0.26b1\r\nopentelemetry-propagator-b3            1.7.1\r\nopentelemetry-proto                    1.7.1\r\nopentelemetry-sdk                      1.7.1\r\nopentelemetry-semantic-conventions     0.26b1\r\nopentelemetry-util-http                0.26b1\r\n```\r\n\r\n**What is the expected behavior?**\r\nWhat did you expect to see?\r\nlogging should be instrumented properly.\r\n\r\n**What is the actual behavior?**\r\nWhat did you see instead?\r\nlogging should be instrumented properly and populate the otelTraceID and otelSpanID in the logs.\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n\r\n$ python3 --version\r\nPython 3.8.10\r\n\r\nmanage.py:\r\n\r\n```\r\n#!/usr/bin/env python\r\n\"\"\"Django's command-line utility for administrative tasks.\"\"\"\r\nimport os\r\nimport sys\r\nimport logging\r\nfrom opentelemetry.instrumentation.django import DjangoInstrumentor\r\nfrom opentelemetry.instrumentation.logging import LoggingInstrumentor\r\n\r\n\r\ndef main():\r\n    \"\"\"Run administrative tasks.\"\"\"\r\n    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_project.settings')\r\n    logging.basicConfig(level = logging.DEBUG)\r\n    LoggingInstrumentor().instrument(set_logging_format=True)\r\n    DjangoInstrumentor().instrument()\r\n    # LoggingInstrumentor().instrument(set_logging_format=True,log_level=logging.DEBUG)\r\n\r\n    try:\r\n        from django.core.management import execute_from_command_line\r\n    except ImportError as exc:\r\n        raise ImportError(\r\n            \"Couldn't import Django. Are you sure it's installed and \"\r\n            \"available on your PYTHONPATH environment variable? Did you \"\r\n            \"forget to activate a virtual environment?\"\r\n        ) from exc\r\n    execute_from_command_line(sys.argv)\r\n\r\n\r\nif __name__ == '__main__':\r\n    main()\r\n```\r\n\r\n\n", "before_files": [{"content": "# Copyright The OpenTelemetry Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# pylint: disable=empty-docstring,no-value-for-parameter,no-member,no-name-in-module\n\nimport logging  # pylint: disable=import-self\nfrom os import environ\nfrom typing import Collection\n\nfrom opentelemetry.instrumentation.instrumentor import BaseInstrumentor\nfrom opentelemetry.instrumentation.logging.constants import (\n    _MODULE_DOC,\n    DEFAULT_LOGGING_FORMAT,\n)\nfrom opentelemetry.instrumentation.logging.environment_variables import (\n    OTEL_PYTHON_LOG_CORRELATION,\n    OTEL_PYTHON_LOG_FORMAT,\n    OTEL_PYTHON_LOG_LEVEL,\n)\nfrom opentelemetry.instrumentation.logging.package import _instruments\nfrom opentelemetry.trace import (\n    INVALID_SPAN,\n    INVALID_SPAN_CONTEXT,\n    get_current_span,\n    get_tracer_provider,\n)\n\n__doc__ = _MODULE_DOC\n\nLEVELS = {\n    \"debug\": logging.DEBUG,\n    \"info\": logging.INFO,\n    \"warning\": logging.WARNING,\n    \"error\": logging.ERROR,\n}\n\n\nclass LoggingInstrumentor(BaseInstrumentor):  # pylint: disable=empty-docstring\n    __doc__ = f\"\"\"An instrumentor for stdlib logging module.\n\n    This instrumentor injects tracing context into logging records and optionally sets the global logging format to the following:\n\n    .. code-block::\n\n        {DEFAULT_LOGGING_FORMAT}\n\n    Args:\n        tracer_provider: Tracer provider instance that can be used to fetch a tracer.\n        set_logging_format: When set to True, it calls logging.basicConfig() and sets a logging format.\n        logging_format: Accepts a string and sets it as the logging format when set_logging_format\n            is set to True.\n        log_level: Accepts one of the following values and sets the logging level to it.\n            logging.INFO\n            logging.DEBUG\n            logging.WARN\n            logging.ERROR\n            logging.FATAL\n\n    See `BaseInstrumentor`\n    \"\"\"\n\n    _old_factory = None\n\n    def instrumentation_dependencies(self) -> Collection[str]:\n        return _instruments\n\n    def _instrument(self, **kwargs):\n        service_name = \"\"\n        provider = kwargs.get(\"tracer_provider\", None) or get_tracer_provider()\n        resource = provider.resource if provider else None\n        if resource:\n            service_name = resource.attributes.get(\"service.name\")\n\n        old_factory = logging.getLogRecordFactory()\n        LoggingInstrumentor._old_factory = old_factory\n\n        def record_factory(*args, **kwargs):\n            record = old_factory(*args, **kwargs)\n\n            record.otelSpanID = \"0\"\n            record.otelTraceID = \"0\"\n            record.otelServiceName = service_name\n\n            span = get_current_span()\n            if span != INVALID_SPAN:\n                ctx = span.get_span_context()\n                if ctx != INVALID_SPAN_CONTEXT:\n                    record.otelSpanID = format(ctx.span_id, \"016x\")\n                    record.otelTraceID = format(ctx.trace_id, \"032x\")\n            return record\n\n        logging.setLogRecordFactory(record_factory)\n\n        set_logging_format = kwargs.get(\n            \"set_logging_format\",\n            environ.get(OTEL_PYTHON_LOG_CORRELATION, \"false\").lower()\n            == \"true\",\n        )\n\n        if set_logging_format:\n            log_format = kwargs.get(\n                \"logging_format\", environ.get(OTEL_PYTHON_LOG_FORMAT, None)\n            )\n            log_format = log_format or DEFAULT_LOGGING_FORMAT\n\n            log_level = kwargs.get(\n                \"log_level\", LEVELS.get(environ.get(OTEL_PYTHON_LOG_LEVEL))\n            )\n            log_level = log_level or logging.INFO\n\n            logging.basicConfig(format=log_format, level=log_level)\n\n    def _uninstrument(self, **kwargs):\n        if LoggingInstrumentor._old_factory:\n            logging.setLogRecordFactory(LoggingInstrumentor._old_factory)\n            LoggingInstrumentor._old_factory = None\n", "path": "instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py"}], "after_files": [{"content": "# Copyright The OpenTelemetry Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# pylint: disable=empty-docstring,no-value-for-parameter,no-member,no-name-in-module\n\nimport logging  # pylint: disable=import-self\nfrom os import environ\nfrom typing import Collection\n\nfrom opentelemetry.instrumentation.instrumentor import BaseInstrumentor\nfrom opentelemetry.instrumentation.logging.constants import (\n    _MODULE_DOC,\n    DEFAULT_LOGGING_FORMAT,\n)\nfrom opentelemetry.instrumentation.logging.environment_variables import (\n    OTEL_PYTHON_LOG_CORRELATION,\n    OTEL_PYTHON_LOG_FORMAT,\n    OTEL_PYTHON_LOG_LEVEL,\n)\nfrom opentelemetry.instrumentation.logging.package import _instruments\nfrom opentelemetry.trace import (\n    INVALID_SPAN,\n    INVALID_SPAN_CONTEXT,\n    get_current_span,\n    get_tracer_provider,\n)\n\n__doc__ = _MODULE_DOC\n\nLEVELS = {\n    \"debug\": logging.DEBUG,\n    \"info\": logging.INFO,\n    \"warning\": logging.WARNING,\n    \"error\": logging.ERROR,\n}\n\n\nclass LoggingInstrumentor(BaseInstrumentor):  # pylint: disable=empty-docstring\n    __doc__ = f\"\"\"An instrumentor for stdlib logging module.\n\n    This instrumentor injects tracing context into logging records and optionally sets the global logging format to the following:\n\n    .. code-block::\n\n        {DEFAULT_LOGGING_FORMAT}\n\n    Args:\n        tracer_provider: Tracer provider instance that can be used to fetch a tracer.\n        set_logging_format: When set to True, it calls logging.basicConfig() and sets a logging format.\n        logging_format: Accepts a string and sets it as the logging format when set_logging_format\n            is set to True.\n        log_level: Accepts one of the following values and sets the logging level to it.\n            logging.INFO\n            logging.DEBUG\n            logging.WARN\n            logging.ERROR\n            logging.FATAL\n\n    See `BaseInstrumentor`\n    \"\"\"\n\n    _old_factory = None\n\n    def instrumentation_dependencies(self) -> Collection[str]:\n        return _instruments\n\n    def _instrument(self, **kwargs):\n\n        provider = kwargs.get(\"tracer_provider\", None) or get_tracer_provider()\n        old_factory = logging.getLogRecordFactory()\n        LoggingInstrumentor._old_factory = old_factory\n\n        service_name = None\n\n        def record_factory(*args, **kwargs):\n            record = old_factory(*args, **kwargs)\n\n            record.otelSpanID = \"0\"\n            record.otelTraceID = \"0\"\n\n            nonlocal service_name\n            if service_name is None:\n                resource = getattr(provider, \"resource\", None)\n                if resource:\n                    service_name = (\n                        resource.attributes.get(\"service.name\") or \"\"\n                    )\n                else:\n                    service_name = \"\"\n\n            record.otelServiceName = service_name\n\n            span = get_current_span()\n            if span != INVALID_SPAN:\n                ctx = span.get_span_context()\n                if ctx != INVALID_SPAN_CONTEXT:\n                    record.otelSpanID = format(ctx.span_id, \"016x\")\n                    record.otelTraceID = format(ctx.trace_id, \"032x\")\n            return record\n\n        logging.setLogRecordFactory(record_factory)\n\n        set_logging_format = kwargs.get(\n            \"set_logging_format\",\n            environ.get(OTEL_PYTHON_LOG_CORRELATION, \"false\").lower()\n            == \"true\",\n        )\n\n        if set_logging_format:\n            log_format = kwargs.get(\n                \"logging_format\", environ.get(OTEL_PYTHON_LOG_FORMAT, None)\n            )\n            log_format = log_format or DEFAULT_LOGGING_FORMAT\n\n            log_level = kwargs.get(\n                \"log_level\", LEVELS.get(environ.get(OTEL_PYTHON_LOG_LEVEL))\n            )\n            log_level = log_level or logging.INFO\n\n            logging.basicConfig(format=log_format, level=log_level)\n\n    def _uninstrument(self, **kwargs):\n        if LoggingInstrumentor._old_factory:\n            logging.setLogRecordFactory(LoggingInstrumentor._old_factory)\n            LoggingInstrumentor._old_factory = None\n", "path": "instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py"}]}