Improved logging for Bottle.
Use
In order to catch exceptions from other plugins the LoggingPlugin should be the first plugin you install to the application.
import bottle
from bottle_log import LoggingPlugin
app = bottle.Bottle()
app.install(LoggingPlugin(app.config))
@app.get('/test')
def test(logger):
logger.warning('This is only a test')
return {}
Configuration
The plugin uses the following configuration keys:
logging.level
The logging level. Possible values: debug, info, warning, error, critical. Defaults to warning.
logging.format
The logging format. See the python logging documentation for the format. Defaults to “[%(asctime)s] %(levelname)s: %(name)s: %(message)s”
logging.utc
If True, the default, time stamps are in UTC.
Logging
The standard logger, used by the logger keyword, prints to stderr by default.
Exception logging
This plugin also provides an exception logger (‘bottle.exception’). By default this logger does nothing, since bottle prints all exceptions to stderr, but it can be useful if you want to log exceptions to somewhere else. For example, logging to Logentries:
import bottle
from logentries import LogentriesHandler
from bottle_log import LoggingPlugin
app = bottle.Bottle()
app.install(LoggingPlugin(app.config))
le_handler = LogentriesHandler('logentries-api-token')
logging.getLogger('bottle.exception').addHandler(le_handler)
Metadata
Release files for bottle-log 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bottle-log-1.0.0.tar.gz | 3.5 kB | Without provenance | Details for bottle-log-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bottle_log-1.0.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for bottle_log-1.0.0-py2.py3-none-any.whl |
Total release size: 8.9 kB
Release files / bottle-log-1.0.0.tar.gz
| Download URL | bottle-log-1.0.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5f03b8d64bfd577dea9b23d9cb999df078916be6951c5700644e14caa294f37
|
|
BLAKE2b-256 checksum How to use checksums |
1c8562a960db8bc6ba424b123d0993326493f17b760a5bc6d5d2f56ace128133
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / bottle_log-1.0.0-py2.py3-none-any.whl
| Download URL | bottle_log-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c549e3d1e612b7b8e7ed0ab684676b94007e764b5789cbb2c3eda0d4ae78e2ff
|
|
BLAKE2b-256 checksum How to use checksums |
25d8825ccfebaf20cad9201e5961a05dcbb43834b653ae141a251cebd80b8ecf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for bottle-log 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.