TowerDB
A Tower reporter that stores errors and exceptions in a PostgreSQL database using Ecto.
Warning
Not production ready. TowerDB is under active development and its API may still change. We use it in several applications at Mimiquate, but it hasn't yet reached the bar we'd consider production ready. Use it at your own risk.
Features we're waiting on before calling it production ready:
- Pruner
- Enable / Disable reporter via config var and via remote shell
- Performance test
Installation
Add tower_db to your list of dependencies in mix.exs:
def deps do
[
{:tower_db, "~> 0.8.0"}
]
end
Then fetch the dependencies:
mix deps.get
Setup
Add TowerDB to your Tower reporters:
# config/config.exs
config :tower, reporters: [TowerDB]
Configure the Ecto repo that TowerDB will use to store events:
config :tower_db, repo: MyApp.Repo
TowerDB requires database tables to store error events. Generate an Ecto migration:
mix ecto.gen.migration add_tower_db
If you want to use a repo different from MyApp.Repo as its primary repo, specify it with the -r flag:
mix ecto.gen.migration add_tower_db -r MyApp.SecondaryRepo
Then add the following content to the generated migration file:
defmodule MyApp.Repo.Migrations.AddTowerDB do
use Ecto.Migration
def up, do: TowerDB.Migration.up(from: 0, to: 7)
def down, do: TowerDB.Migration.down(from: 7, to: 0)
end
Run the migration:
mix ecto.migrate
License
See LICENSE.