View logger
View Logger is a decorators for Django views. It allows you to collect basic information about the user who made the request and about errors.
Quick start
-
Create empty dir
logsin the root of your project -
Create
loggingconfiguration in your setting. By default,view-loggeruseserror_loggerandinfo_logger. These two loggers should be in the logging settings.
LOGGING = {
'version': 1,
'formatters': {
...
},
'handlers': {
...
},
'loggers': {
'info_logger': {
...
},
'error_logger': {
...
},
},
}
- Import from
view_loggerdecorators:log_wrapperorhttp_logger
log_wrapper - Decorator for logging unhandled errors.
http_logger - Decorator for logging user`s information and unhandled errors.
Extra tuning
You can specify additional keys in the settings for additional configuration.
HTTP_ERROR_LOGGER - you can set your custom logger name for using. Default is error_logger.
HTTP_INFO_LOGGER - you can set your custom logger name for using. Default is info_logger.
USER_OBJECT - for use other then django user object in request. Default is user.
If you want to change the object where the user data comes from, you must set user-like object in request object.
Metadata
Release files for view-logger 1.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 | |
|---|---|---|---|---|
| view-logger-1.0.tar.gz | 4.0 kB | Without provenance | Details |
Release files / view-logger-1.0.tar.gz
| Download URL | view-logger-1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fff6fe8424371ead3b17038ec5d22ca7a7806d1f9ab2a5b1fb2e8e0bc5d80b15
|
|
BLAKE2b-256 checksum How to use checksums |
12a03808a8f3dc7f44ba709060e6de79e834eaf1f7ea6f87e98b51bce95b2903
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0
|
Security for view-logger 1.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.