mirror of https://github.com/status-im/timbre.git
36 lines
9.2 KiB
HTML
36 lines
9.2 KiB
HTML
<!DOCTYPE html PUBLIC ""
|
|
"">
|
|
<html><head><meta charset="UTF-8" /><link href="css/default.css" rel="stylesheet" type="text/css" /><script src="js/jquery.min.js" type="text/javascript"></script><script src="js/page_effects.js" type="text/javascript"></script><title>taoensso.timbre.appenders.3rd-party.postgresql documentation</title></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Timbre</span> <span class="project-version">4.6.0</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>taoensso</span></div></div></li><li class="depth-2"><a href="taoensso.timbre.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>timbre</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>appenders</span></div></div></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>3rd-party</span></div></div></li><li class="depth-5 branch"><a href="taoensso.timbre.appenders.3rd-party.gelf.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>gelf</span></div></a></li><li class="depth-5 branch"><a href="taoensso.timbre.appenders.3rd-party.irclj.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>irclj</span></div></a></li><li class="depth-5 branch current"><a href="taoensso.timbre.appenders.3rd-party.postgresql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>postgresql</span></div></a></li><li class="depth-5 branch"><a href="taoensso.timbre.appenders.3rd-party.rolling.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rolling</span></div></a></li><li class="depth-5 branch"><a href="taoensso.timbre.appenders.3rd-party.rotor.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rotor</span></div></a></li><li class="depth-5"><a href="taoensso.timbre.appenders.3rd-party.slack.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>slack</span></div></a></li><li class="depth-4 branch"><a href="taoensso.timbre.appenders.carmine.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>carmine</span></div></a></li><li class="depth-4 branch"><a href="taoensso.timbre.appenders.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-4 branch"><a href="taoensso.timbre.appenders.example.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>example</span></div></a></li><li class="depth-4"><a href="taoensso.timbre.appenders.postal.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>postal</span></div></a></li><li class="depth-3 branch"><a href="taoensso.timbre.profiling.html"><div class="inner"><span class="tree" style="top: -362px;"><span class="top" style="height: 371px;"></span><span class="bottom"></span></span><span>profiling</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tools</span></div></div></li><li class="depth-4"><a href="taoensso.timbre.tools.logging.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logging</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="taoensso.timbre.appenders.3rd-party.postgresql.html#var-conn"><div class="inner"><span>conn</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.appenders.3rd-party.postgresql.html#var-connect"><div class="inner"><span>connect</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.appenders.3rd-party.postgresql.html#var-default-pool-spec"><div class="inner"><span>default-pool-spec</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.appenders.3rd-party.postgresql.html#var-ensure-conn"><div class="inner"><span>ensure-conn</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.appenders.3rd-party.postgresql.html#var-log-message"><div class="inner"><span>log-message</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.appenders.3rd-party.postgresql.html#var-pgsql-appender"><div class="inner"><span>pgsql-appender</span></div></a></li><li class="depth-1"><a href="taoensso.timbre.appenders.3rd-party.postgresql.html#var-pool"><div class="inner"><span>pool</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">taoensso.timbre.appenders.3rd-party.postgresql</h1><div class="doc"><pre class="plaintext">JDBC PostgreSQL database appender.
|
|
Requires <a href="https://github.com/clojure/java.jdbc">https://github.com/clojure/java.jdbc</a>,
|
|
<a href="https://github.com/swaldman/c3p0">https://github.com/swaldman/c3p0</a>.</pre></div><div class="public anchor" id="var-conn"><h3>conn</h3><div class="usage"></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/appenders/3rd_party/postgresql.clj#L28">view source</a></div></div><div class="public anchor" id="var-connect"><h3>connect</h3><div class="usage"><code>(connect config)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/appenders/3rd_party/postgresql.clj#L24">view source</a></div></div><div class="public anchor" id="var-default-pool-spec"><h3>default-pool-spec</h3><div class="usage"></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/appenders/3rd_party/postgresql.clj#L23">view source</a></div></div><div class="public anchor" id="var-ensure-conn"><h3>ensure-conn</h3><div class="usage"><code>(ensure-conn config)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/appenders/3rd_party/postgresql.clj#L29">view source</a></div></div><div class="public anchor" id="var-log-message"><h3>log-message</h3><div class="usage"><code>(log-message config data)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/appenders/3rd_party/postgresql.clj#L31">view source</a></div></div><div class="public anchor" id="var-pgsql-appender"><h3>pgsql-appender</h3><div class="usage"><code>(pgsql-appender db-config)</code></div><div class="doc"><pre class="plaintext">Returns a JDBC PostgreSQL appender.
|
|
(pglog-appender {:server {:host "127.0.0.1" :port 5432}})
|
|
|
|
SQL ddl script for table creation and rollback
|
|
----------------------------------------------
|
|
|
|
```
|
|
CREATE TABLE IF NOT EXISTS logs (
|
|
log_id bigserial primary key,
|
|
instant timestamp NOT NULL,
|
|
level varchar(20) NOT NULL,
|
|
namespace varchar(50) NOT NULL,
|
|
hostname varchar(30) NOT NULL,
|
|
content text NOT NULL,
|
|
error text NOT NULL
|
|
);
|
|
|
|
DROP TABLE IF EXISTS logs;
|
|
```
|
|
|
|
To automate database migration
|
|
------------------------------
|
|
|
|
* Using Migratus + Leiningen (in profiles.clj):
|
|
:database-url "postgresql://<db_username>:<db_password>@<db_servername>:<db_port>/<db_schema>"
|
|
|
|
* Using Boot + Ragtime (in build.boot):
|
|
ragtime {:driver-class "org.postgresql.Driver"
|
|
:database (str "jdbc:postgresql://<dbserver_name>:<db_port>/"
|
|
"<db_schema>"
|
|
"?user=<db_usernmae>"
|
|
"&password=<db_password>")})</pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/appenders/3rd_party/postgresql.clj#L43">view source</a></div></div><div class="public anchor" id="var-pool"><h3>pool</h3><div class="usage"><code>(pool spec)</code></div><div class="doc"><pre class="plaintext"></pre></div><div class="src-link"><a href="https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/appenders/3rd_party/postgresql.clj#L11">view source</a></div></div></div></body></html> |