{"id":15374189,"url":"https://github.com/stil/zlog-sql","last_synced_at":"2025-07-27T19:39:16.900Z","repository":{"id":31331417,"uuid":"103158761","full_name":"stil/zlog-sql","owner":"stil","description":"MySQL/SQLite logging plugin for ZNC IRC bouncer written in Python 3","archived":false,"fork":false,"pushed_at":"2022-04-21T12:49:55.000Z","size":24,"stargazers_count":9,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T01:02:02.921Z","etag":null,"topics":["irc","logging","mysql","sqlite","znc","znc-irc-bouncer"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-11T16:13:43.000Z","updated_at":"2022-03-27T19:15:36.000Z","dependencies_parsed_at":"2022-08-07T16:15:48.844Z","dependency_job_id":null,"html_url":"https://github.com/stil/zlog-sql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stil%2Fzlog-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stil%2Fzlog-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stil%2Fzlog-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stil%2Fzlog-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stil","download_url":"https://codeload.github.com/stil/zlog-sql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249094932,"owners_count":21211837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["irc","logging","mysql","sqlite","znc","znc-irc-bouncer"],"created_at":"2024-10-01T13:57:37.438Z","updated_at":"2025-04-15T15:10:59.199Z","avatar_url":"https://github.com/stil.png","language":"Python","readme":"# zlog-sql\nMySQL/SQLite logging plugin for ZNC IRC bouncer written in Python 3\n\n## Features\n* Supports MySQL, PostgreSQL and SQLite databases.\n* Asynchronous database writes on separate thread. Guarantees that ZNC won't hang during SQL connection timeout.\n* Automatic table creation (`CREATE TABLE IF NOT EXIST`)\n* Retry after failed inserts. When database server is offline, logs are buffered to memory. They are saved when database is back online, so you won't lose logs during MySQL/PostgreSQL outages. \n\n## Some statistics\nAfter having this plugin enabled for around 11 months, below are my statistics of MySQL table:\n* Total logs count: more than 4.87 million.\n* Space usage: 386 MB (data 270 MB, index 116 MB)\n\nMySQL gives great compression ratio and is easily searchable. SQLite database doesn't support compression, but it's easier to setup and migrate.\n\n## Quick start\n1. Copy `zlog_sql.py` to `~/.znc/modules/zlog_sql.py`.\n2. In Webadmin, open the list of Global Modules.\n3. Make sure `modpython` is enabled.\n4. Enable module `zlog_sql` and set its argument.\n\n![Screenshot](docs/webadmin_modules.png)\n\n### MySQL\nFor MySQL, set module argument matching following format:\n```\nmysql://username:password@localhost/database_name\n```\n**Important:** you need [`PyMySQL`](https://github.com/PyMySQL/PyMySQL) pip package for MySQL logging. Install it with `pip3 install PyMySQL` command.\n\n### PostgreSQL\nFor PostgreSQL, set module argument matching following format:\n```\npostgres://username:password@localhost/database_name\n```\n**Important:** you need [`psycopg2`](https://github.com/psycopg/psycopg2) pip package for PostgreSQL logging. Install it with `pip3 install psycopg2` command.\n\n\n### SQLite\nFor SQLite use following string format:\n```\nsqlite:///home/user/logs.sqlite\n```\n\nor simply leave out the path\n```\nsqlite\n```\nin this case, logs are going to be written to the default path `~/.znc/moddata/zlog_sql/logs.sqlite`.\n\n5. Save changes. SQL table schema is going to be created automatically.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstil%2Fzlog-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstil%2Fzlog-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstil%2Fzlog-sql/lists"}