Skip to content

frozzare/couchdb-logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

couchdb-logging

Simple logging system for WordPress using CouchDB

Installation

Download the plugin via GitHub and add this to your wp-config.php or something.

<?php

define('CB_HOST', '127.0.0.1');
define('CB_PORT', '5984');
define('CB_NAME', 'my-awesome-database');

// you can also have login, optional.

define('CB_USER', 'user');
define('CB_PASSWORD', 'password');
?>

If no CouchDB options is defined it will use the host 127.0.0.1, the default port 5984 and the database name wordpress-logging . Now you are ready to start logging!

<?php

// Will return the document from the database or false if something goes wrong.
couchdb_log('info', array('status' => 'ok'));

?>

Get all logs from the database

<?php
  
  $logs = get_couchdb_logs([$limit ,] [$endKey ,] [$descending]);

?>
  • $limit Is the count of documents to return.
  • $endKey Is the timestamp to stop at.
  • $descending It's speaks for it self.

Todo

  • Add WordPress view where you can sort and view the logs.
  • Fix so it don't break the site when Sag failes.

About

Simple logging system for WordPress using CouchDB

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published