Repository: learningequality/kolibri

Issue:
Duplicate logging 
<!--
Instructions:
 * Fill out the sections below, replace …'s with information about your issue
 * Use the 'preview' function above this text box to verify formatting before submitting
-->

### Observed behavior
<!--
Description of the behavior that was observed, including screenshots or other references when applicable
-->

Some messages are logged twice.

```
INFO     Running Kolibri with the following settings: kolibri.deployment.default.settings.base
INFO:kolibri.core.apps:Running Kolibri with the following settings: kolibri.deployment.default.settings.base
INFO     Starting webpack process with linting from Django runserver command
INFO:kolibri.core.webpack.management.commands.devserver:Starting webpack process with linting from Django runserver command
INFO     Django Runserver command has spawned a Webpack watcher process on pid 7364
INFO:kolibri.core.webpack.management.commands.devserver:Django Runserver command has spawned a Webpack watcher process on pid 7364

```

### Expected behavior
<!--
Description of what behavior was expected but did not occur
-->

No duplicate logging.

### User-facing consequences
<!--
Implications and real-world consequences for learners, coaches, admins, and other users of the application
-->

Unnecessary noise for developers. 

### Errors and logs
<!--
Relevant logs from:
 * the command line
 * ~/.kolibri/kolibri.log
 * the browser console

Please wrap errors in triple backticks for clean formatting like this:
```
01:10 info: something happened
01:12 error: something bad happened
```
-->

…

### Steps to reproduce
<!--
Precise steps that someone else can follow in order to see this behavior
-->

Start devserver.

### Context
<!--
Tell us about your environment, including:
 * Kolibri version
 * Operating system
 * Browser
-->

Develop




Discussion:
I think this is happening everywhere where python `logging` is used. Maybe introduced by Django upgrade?
that happened in this PR fyi: https://github.com/learningequality/kolibri/pull/2882
I am not replicating this locally, is this still extant?
I'm still reproducing this. For example:

```
INFO     "GET /api/session/current/?active=false HTTP/1.1" 200 114
INFO:django.server:"GET /api/session/current/?active=false HTTP/1.1" 200 114
```

```
INFO     Starting webpack process from Django runserver command
INFO:kolibri.core.webpack.management.commands.devserver:Starting webpack process from Django runserver command
```

```
INFO     Running Kolibri with the following settings: kolibri.deployment.default.settings.base
INFO:kolibri.core.apps:Running Kolibri with the following settings: kolibri.deployment.default.settings.base
```


And only on develop, not 0.7?
Looks like it's on 0.7 also:

```
INFO     Running Kolibri with the following settings: kolibri.deployment.default.settings.base
INFO:kolibri.core.apps:Running Kolibri with the following settings: kolibri.deployment.default.settings.base
INFO     Starting webpack process from Django runserver command
INFO:kolibri.core.webpack.management.commands.devserver:Starting webpack process from Django runserver command
INFO     Django Runserver command has spawned a Webpack watcher process on pid 7650
INFO:kolibri.core.webpack.management.commands.devserver:Django Runserver command has spawned a Webpack watcher process on pid 7650
```
cc @benjaoming any ideas how to address this?
Do we need to add a `NullHandler` in the `__init__.py`?

https://docs.python-guide.org/writing/logging/#logging-in-a-library

Resolving patch:
diff --git a/kolibri/deployment/default/settings/base.py b/kolibri/deployment/default/settings/base.py
--- a/kolibri/deployment/default/settings/base.py
+++ b/kolibri/deployment/default/settings/base.py
@@ -322,6 +322,7 @@
         'kolibri': {
             'handlers': ['console', 'mail_admins', 'file', 'file_debug'],
             'level': 'INFO',
+            'propagate': False,
         },
         'iceqube': {
             'handlers': ['file', 'console'],
diff --git a/kolibri/utils/options.py b/kolibri/utils/options.py
--- a/kolibri/utils/options.py
+++ b/kolibri/utils/options.py
@@ -130,6 +130,7 @@ def get_logger(KOLIBRI_HOME):
             'kolibri': {
                 'handlers': ['console', 'file'],
                 'level': 'INFO',
+                'propagate': False,
             },
         }
     }


Test patch: