EctoLoggerJson

Log ecto data as JSON with slightly different fields

Dependencies

Installation

If available in Hex, the package can be installed as:

  1. Add ecto_logger_json to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:ecto_logger_json, "~> 0.1.0"}]
end
```
  1. Ensure ecto_logger_json is started before your application:
```elixir
def application do
  [applications: [:ecto_logger_json]]
end
```
  1. Configure ecto logging in config/enviroment_name.exs
```elixir
config :my_app, MyApp.Repo,
adapter: Ecto.Adapters.Postgres,
...
loggers: [{Ecto.LoggerJSON, :log, [:info]}]
```

Additonal Setup depending on your use case

My recommendation would be to only log to a file and not console otherwise stdout when you are in iex gets very noisy from all the db logs.

Contributing

Before submitting your pull request, please run:

Please squash your pull request’s commits into a single commit with a message and detailed description explaining the commit.