
========================
Double logging in gurobi
========================

When using the gurobi solver you may see some of the logs generated by gurobi during the solve
are duplicated.

e.g.

.. code-block:: bash

    Total elapsed time = 498.27s
    [INFO] Total elapsed time = 498.27s

This is because the gurobi logger both prints to the console and propagates to the root logger.

Adding the following to your application code before call solve should fix the issue.

.. code-block:: python

    logger = logging.getLogger("gurobipy")
    logger.propagate = False


.. _Further information: https://groups.google.com/g/gurobi/c/sV7xxN_mzCk
