<p>Using something like this:</p>

<pre><code>try:
   # Something...
except Exception as excep:
   logger = logging.getLogger("component")
   logger.warning("something raised an exception: " + excep)
   logger.info("something raised an exception: " + excep)
</code></pre>

<p>I would rather not have it on the error-level cause in my special case it is not an error.</p>

From the
logging documentation
:
There are three keyword arguments in
```
kwargs
```
which are inspected:
```
exc_info
```
,
```
stack_info
```
, and
```
extra
```
.
If
```
exc_info
```
does not evaluate as false, it causes exception information to be added to the logging message. If an exception tuple (in the format returned by
```
sys.exc_info()
```
) or an exception instance is provided, it is used; otherwise,
```
sys.exc_info()
```
is called to get the exception information.
So do:
```
```
logger.warning("something raised an exception:", exc_info=True)
```
```