
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Configurable logger that writes to CLI, file, HTTP API, and optional databases via simple JSON config.
Configurable, typed Python logger that can write to CLI, file, HTTP API, and databases. Controlled by a simple JSON config file cnblogger.config.
pip install cnblogger # base (no optional deps)
pip install "cnblogger[colors]" # CLI colors via colorama
pip install "cnblogger[api]" # HTTP API sink via requests
pip install "cnblogger[sqlite]" # SQLite (built-in stdlib, extras not required)
pip install "cnblogger[mysql]" # MySQL via PyMySQL
pip install "cnblogger[postgres]" # PostgreSQL via psycopg2-binary
pip install "cnblogger[mongo]" # MongoDB via pymongo
pip install "cnblogger[all]" # everything
from cnblogger import CNBLogger
logger = CNBLogger() # auto-loads ./cnblogger.config if present
logger.info("App started")
logger.error("Something went wrong")
If cnblogger.config does not exist, it will be created automatically with defaults on first use. You can also copy from cnblogger.config.example.
Config location:
cnblogger.config in the app's current working directory (CWD).export CNBLOGGER_CONFIG=/path/to/cnblogger.config
from cnblogger import CNBLogger
logger = CNBLogger(config_path="/path/to/cnblogger.config")
Create or edit a cnblogger.config JSON file in your project root (or set CNBLOGGER_CONFIG env var to a path). Example with databases:
{
"mode": "all",
"delimiter": "|",
"file_dir": "./.logs",
"file_same_day_mode": "append",
"api_url": "https://log.example.com/ingest",
"api_verify": true,
"api_timeout_seconds": 3.0,
"api_headers": {"Authorization": "Bearer <token>"},
"db_sqlite_path": "./.logs/logs.db",
"db_sqlite_table": "logs",
"db_mysql": {"host": "localhost", "port": 3306, "user": "root", "password": "", "database": "logs", "table": "logs"},
"db_postgres": {"host": "localhost", "port": 5432, "user": "postgres", "password": "", "database": "logs", "table": "logs", "sslmode": "prefer"},
"db_mongo_uri": "mongodb://localhost:27017",
"db_mongo_database": "logs",
"db_mongo_collection": "entries",
"colors": {"INFO": "cyan", "CRITICAL": "red", "ERROR": "bright_yellow", "WARN": "yellow", "DEBUG": "blue"},
"timestamp_utc": false
}
cli | file | api | both (cli+file) | all (cli+file+api). Default: cli.yyyymmdd.log (append by default on same day). If file_same_day_mode is new, files are yyyymmdd_HHMMSS.log.[yyyy.mm.dd hh:mm:ss.mmm] [LEVEL] message (LEVEL colored, colors configurable).ts|LEVEL|message or in columns.api_verify to true/false or a CA bundle path. Protocol is inferred from api_url.db_sqlite_path and optional db_sqlite_table.db_mysql object with connection details and table.db_postgres object; optional sslmode.db_mongo_uri, db_mongo_database, db_mongo_collection.The package is typed (py.typed). All public APIs include type hints.
MIT - See the LICENSE file.
FAQs
Configurable logger that writes to CLI, file, HTTP API, and optional databases via simple JSON config.
We found that cnblogger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.

Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.

Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.