To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

ZLog SQL: Difference between revisions

From ZNC
Jump to navigation Jump to search
Lipvig (talk | contribs)
No edit summary
Lipvig (talk | contribs)
mNo edit summary
Line 1: Line 1:
{{External Module}}
{{External Module}}


MySQL/SQLite logging plugin for ZNC IRC bouncer written in Python 3.
This is a global Python module for MySQL/SQLite logging.


GitHub repository and latest version can be found here: https://github.com/stil/zlog-sql
GitHub repository: https://github.com/stil/zlog-sql


== Quick start ==
== Quick start ==

Revision as of 02:52, 12 September 2017

This is a global Python module for MySQL/SQLite logging.

GitHub repository: https://github.com/stil/zlog-sql

Quick start

  1. Copy zlog_sql.py to ~/.znc/modules/zlog_sql.py.
  2. In Webadmin, open the list of Global Modules.
  3. Make sure modpython is enabled.
  4. Enable module zlog_sql and set its argument.

For MySQL, set module argument matching following format:

mysql://username:password@localhost/database_name

Important: you need PyMySQL pip package for MySQL logging. Install it with pip3 install PyMySQL command.

For SQLite use following string format:

sqlite://home/user/logs.sqlite

or simply leave out the path

sqlite

in this case, logs are going to be written to the default path ~/.znc/moddata/zlog_sql/logs.sqlite.

  1. Save changes. SQL table schema is going to be created automatically.