Skip to main content

Forensic logging setup for python projects

Project description

The tool has been developed for the purpose of facilitating the forensic aspects of logging configurations.
It enables users to easy customize their logging environment by specifying parameters such as file names and directory structures.
For example you can easy configure your logging with the logging-directory and the name of the logging file _.log
To use logging-forensic install the modul via pip and use it (see example usage)

install logging-forensic via pip

pip install git+https://github.com/fackelm2/logging-forensic.git

update logging-forensic via pip

pip install --upgrade --force-reinstall git+https://github.com/fackelm2/logging-forensic.git

example usage of logger-forensic in your python script:

from logging-forensic import forensic_logger

timestring = time.strftime("%Y%m%d-%H%M%S")
logfile_path = Path(__file__).resolve().parent.parent / "log" / f"{timestring}_<case>.log"
logger = forensic_logger('<scriptname>', logfile_path, 'INFO', False)

example logfile in log/.log

example 2

cat my-script.py

..
from logging_forensic import forensic_logger
..
logfile_path = Path(__file__).resolve().parent.parent / 'log' / f'my-script.log'
logfile_path.parent.mkdir(parents=True, exist_ok=True)
logger = forensic_logger('my-script', logfile_path, console=False, level='INFO', timestamp=True)
..

cat log/my-script.log

..
2025-04-09 17:48:38,712 - INFO - my-script.py OK - downloaded file 1: https://apkid.de/test1.txt to D:\download_data\output\download_20250409174838
2025-04-09 17:48:39,081 - INFO - my-script.py OK - downloaded file 2: https://apkid.de/wallpaper_16487800940ff7b95bc63e4c56a8843b2c50d3b0de.jpeg to D:\download_data\output\download_20250409174838
..

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

logging_forensic-0.1.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

logging_forensic-0.1.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file logging_forensic-0.1.1.tar.gz.

File metadata

  • Download URL: logging_forensic-0.1.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for logging_forensic-0.1.1.tar.gz
Algorithm Hash digest
SHA256 17dc40ed23d2283563b8038ba535041740cce4781290d9fbf7e80f2eca4c4994
MD5 025cd434e8f6560819f3d0f915185a4b
BLAKE2b-256 efcdaab9ceeb6e4d147b87a84a935b206d3bcfa2fb7b6ce5e4163e257f8074ee

See more details on using hashes here.

File details

Details for the file logging_forensic-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for logging_forensic-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf92dbd2ffc425edaf00b2551770b4cd25a91749c6bfc96153a5d485116eda45
MD5 c02c269ec1b4a1c3f8448715fb423f95
BLAKE2b-256 dd87324215a53b88bd4a410c9910134e3b4e3ed58a775aa4fa00d5cdee48d1f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page