PynamoLogger
log information into a dynamodb, with dax support
Install
pip install pynamologger
view Documentation
Usage
create a dynamodb table
indexKey
- appName
rangeKey
- timestamp
Sam template
put this in your template.yaml file under properties section
make sure that the table name is the same in Meta declaration
YourLogTable:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: appName
AttributeType: S
- AttributeName: timestamp
AttributeType: N
BillingMode: PAY_PER_REQUEST
TableName: <put your table name here>
KeySchema:
- AttributeName: appName
KeyType: HASH
- AttributeName: timestamp
KeyType: RANGE
create using pynamodb api
Logger.create_table()
class meta definition
from pynamoLogger.logger import PynamoLogger
class Logger(PynamoLogger):
class Meta:
table_name = 'member-database-log-dev-manual' # put your table name
region = 'ap-southeast-1' #put your region name
billing_mode = 'PAY_PER_REQUEST'
# Logger.create_table()
Logger.log(appName = 'test', message = "this is crazy", responseObject = {'response': 'null response'})
{'logId': 1603075789.054751,
'saveResult': {'ConsumedCapacity': {'CapacityUnits': 1.0,
'TableName': 'member-database-log-dev-manual'}}}
Logger.checkLog(appName = 'test', logId = '1603074235.103042')
[{'appName': None,
'timestamp': 1603074235.103042,
'logMessage': 'this is crazy',
'requestObject': {'noValue': 'noValue'},
'responseObject': {'response': 'null response'}}]
Metadata
Release files for pynamoLogger 0.0.2
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 | |
|---|---|---|---|---|
| pynamoLogger-0.0.2.tar.gz | 10.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pynamoLogger-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.9 kB
Release files / pynamoLogger-0.0.2.tar.gz
| Download URL | pynamoLogger-0.0.2.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0be1adbb1c49a15ff158e7e7d6cd7260ba40c47788cbbcb3955122c1c47eccb
|
|
BLAKE2b-256 checksum How to use checksums |
34459e0e6076414f6716621b2d5fab363109b7a98667f7971b8a637584e8d57e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
|
Release files / pynamoLogger-0.0.2-py3-none-any.whl
| Download URL | pynamoLogger-0.0.2-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5306d8f6c34af42e48eb940594a8d564cd7e6acd32e6921f965e4f4087274924
|
|
BLAKE2b-256 checksum How to use checksums |
c66bbafbcf0d43473a6f9dca7201f879c71dd8a644c60bbbc6dfed38e5601589
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
|
Security for pynamoLogger 0.0.2
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.