We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Checkov logs to stdout making the json un-parseable
**Describe the bug**
When you run checkov with the `-o json` and `LOG_LEVEL=WARNING` the logs are printed to `stdout` together with the json object. This way it's hard and error prone to parse the json output.

**Expected behavior**
At least in `-o json` (or any parseable output) mode It should use stderr to log to and use stdout only for the parseable  output and log everything else to stderr.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `checkov/logging_init.py`
Content:
```
1 import sys
2 
3 import logging
4 import os
5 
6 
7 def init():
8     LOG_LEVEL = os.environ.get('LOG_LEVEL', 'WARNING').upper()
9     logging.basicConfig(level=LOG_LEVEL)
10     logFormatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s]  %(message)s")
11     rootLogger = logging.getLogger()
12     consoleHandler = logging.StreamHandler(sys.stdout)
13     consoleHandler.setFormatter(logFormatter)
14     consoleHandler.setLevel(LOG_LEVEL)
15     rootLogger.addHandler(consoleHandler)
16     logging.getLogger("urllib3").setLevel(logging.ERROR)
17     logging.getLogger("urllib3.connectionpool").setLevel(logging.ERROR)
18     logging.getLogger("urllib3.connectionpool").propagate = False
19     logging.getLogger("urllib3").propagate = False
20
```
--- 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/checkov/logging_init.py b/checkov/logging_init.py
--- a/checkov/logging_init.py
+++ b/checkov/logging_init.py
@@ -9,7 +9,7 @@
     logging.basicConfig(level=LOG_LEVEL)
     logFormatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s]  %(message)s")
     rootLogger = logging.getLogger()
-    consoleHandler = logging.StreamHandler(sys.stdout)
+    consoleHandler = logging.StreamHandler(sys.stderr)
     consoleHandler.setFormatter(logFormatter)
     consoleHandler.setLevel(LOG_LEVEL)
     rootLogger.addHandler(consoleHandler)

{"golden_diff": "diff --git a/checkov/logging_init.py b/checkov/logging_init.py\n--- a/checkov/logging_init.py\n+++ b/checkov/logging_init.py\n@@ -9,7 +9,7 @@\n     logging.basicConfig(level=LOG_LEVEL)\n     logFormatter = logging.Formatter(\"%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s]  %(message)s\")\n     rootLogger = logging.getLogger()\n-    consoleHandler = logging.StreamHandler(sys.stdout)\n+    consoleHandler = logging.StreamHandler(sys.stderr)\n     consoleHandler.setFormatter(logFormatter)\n     consoleHandler.setLevel(LOG_LEVEL)\n     rootLogger.addHandler(consoleHandler)\n", "issue": "Checkov logs to stdout making the json un-parseable\n**Describe the bug**\r\nWhen you run checkov with the `-o json` and `LOG_LEVEL=WARNING` the logs are printed to `stdout` together with the json object. This way it's hard and error prone to parse the json output.\r\n\r\n**Expected behavior**\r\nAt least in `-o json` (or any parseable output) mode It should use stderr to log to and use stdout only for the parseable  output and log everything else to stderr.\r\n\n", "before_files": [{"content": "import sys\n\nimport logging\nimport os\n\n\ndef init():\n    LOG_LEVEL = os.environ.get('LOG_LEVEL', 'WARNING').upper()\n    logging.basicConfig(level=LOG_LEVEL)\n    logFormatter = logging.Formatter(\"%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s]  %(message)s\")\n    rootLogger = logging.getLogger()\n    consoleHandler = logging.StreamHandler(sys.stdout)\n    consoleHandler.setFormatter(logFormatter)\n    consoleHandler.setLevel(LOG_LEVEL)\n    rootLogger.addHandler(consoleHandler)\n    logging.getLogger(\"urllib3\").setLevel(logging.ERROR)\n    logging.getLogger(\"urllib3.connectionpool\").setLevel(logging.ERROR)\n    logging.getLogger(\"urllib3.connectionpool\").propagate = False\n    logging.getLogger(\"urllib3\").propagate = False\n", "path": "checkov/logging_init.py"}], "after_files": [{"content": "import sys\n\nimport logging\nimport os\n\n\ndef init():\n    LOG_LEVEL = os.environ.get('LOG_LEVEL', 'WARNING').upper()\n    logging.basicConfig(level=LOG_LEVEL)\n    logFormatter = logging.Formatter(\"%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s]  %(message)s\")\n    rootLogger = logging.getLogger()\n    consoleHandler = logging.StreamHandler(sys.stderr)\n    consoleHandler.setFormatter(logFormatter)\n    consoleHandler.setLevel(LOG_LEVEL)\n    rootLogger.addHandler(consoleHandler)\n    logging.getLogger(\"urllib3\").setLevel(logging.ERROR)\n    logging.getLogger(\"urllib3.connectionpool\").setLevel(logging.ERROR)\n    logging.getLogger(\"urllib3.connectionpool\").propagate = False\n    logging.getLogger(\"urllib3\").propagate = False\n", "path": "checkov/logging_init.py"}]}