Spyder logging output only in file not IPython Console
<p>I'm having a problem with logging in Spyder.</p>

<p>My code has some important output like a progressbar and some logging.
I don't want the logging to be in the IPython console output, just in the log file.</p>

<p>There is a logging.conf file because i need the TimedRotatingFileHandler and a formatter.</p>

<p>The code looks like this</p>

<pre><code>print('sth important')
logger.info('first print worked')
print('just sth')
</code></pre>

<p>I want the output to be like</p>

<pre><code>sth important
just sth
</code></pre>

<p>and the logfile "output.log"</p>

<pre><code>date - INFO - first print worked
</code></pre>

<p>The Problem is: When I set the logger &amp; handler level in .conf to INFO, the output in the IPython console is</p>

<pre><code>sth important
date - INFO - first print worked
just sth
</code></pre>

<p>logger level WARNING, handler level INFO: neither output in console nor file</p>

<p>logger level INFO, handler level WARNING: output in console, "output.log" empty</p>

<p>In the python.org logging tutorial this works with logging.basicConfig, but how can I combine this with handlers and formatters?</p>

<p>There seems to be a problem with the timedRotatingHandler.
It works fine with the FileHandler.
Just rename the logfile with the datetime and os packages. This may not be the best solution but at least it is working.</p>

python logging console spyder