======
This package is meant to be used to setup logging to the database from a pyramid application.
To include in a pyramid application you need to alter the development.ini/production.ini files.
EXAMPLE INI FILE
================
[loggers]
keys = root, myapp
[handlers]
keys = console, sqlalchemy
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[logger_myapp]
level = DEBUG
handlers = sqlalchemy
qualname = myapp
[handler_sqlalchemy]
class = logservice.handlers.sqlalchemy_handler.SQLAlchemyHandler
args = ()
level = NOTSET
formatter = generic
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
You will also want to create an initialize_log_db.py file in your scripts folder
EXAMPLE initialize_log_db.py
============================
import os
import sys
from logservice.scripts import initializedb
from pyramid.paster import (
get_appsettings,
setup_logging,
)
from pyramid.scripts.common import parse_vars
def usage(argv):
cmd = os.path.basename(argv[0])
print('usage: %s <config_uri> [var=value]\n'
'(example: "%s development.ini")' % (cmd, cmd))
sys.exit(1)
def main(argv=sys.argv):
if len(argv) < 2:
usage(argv)
config_uri = argv[1]
options = parse_vars(argv[2:])
setup_logging(config_uri)
settings = get_appsettings(config_uri, options=options)
log = initializedb.InitializeDb(settings['sqlalchemy.url'])
log.initialize_db()
EXAMPLE setup.py change
=======================
entry_points = """\
[paste.app_factory]
main=myapp:main
[console_scripts]
initialize_log_db = myapp.scripts.initialize_log_db:main
""",
Metadata
Release files for PyramidLogService 0.1
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 |
|---|---|---|---|---|
| PyramidLogService-0.1.tar.gz | 3.8 kB | Without provenance | Details for PyramidLogService-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| PyramidLogService-0.1-py3.5.egg | Legacy Egg format | - | - | Details for PyramidLogService-0.1-py3.5.egg |
Total release size: 16.7 kB
Release files / PyramidLogService-0.1.tar.gz
| Download URL | PyramidLogService-0.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16395f6f9b925a4b4debde20904df0e06487fba9af181ec543713e7c1a734f4e
|
|
BLAKE2b-256 checksum How to use checksums |
e00709de8aa35f3847899a5dc2a6a3f2306e6bb1302e16d82bee7db2a572f505
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / PyramidLogService-0.1-py3.5.egg
| Download URL | PyramidLogService-0.1-py3.5.egg |
|---|---|
| Size | 12.9 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
205dc9269eb862a54e75cf0c037c4aedad0988ef2eabd977ba12cddcdaf1b516
|
|
BLAKE2b-256 checksum How to use checksums |
ea6162b71e4f357c07f9c643bb33f52dabcf999decbdfe6787649dbd5b4acaf8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for PyramidLogService 0.1
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.