Skip to content

zph/ex_json_logger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExJsonLogger

Hex.pm

A drop-in replacement for :console's formatter. ExJsonLogger takes standard Logger calls and JSON encodes them. Ecto and Plug loggers are also included.

Installation

Available in Hex, the package can be installed by adding ex_json_logger to your list of dependencies in mix.exs:

def deps do
  [{:ex_json_logger, "~> 1.0.0"}]
end
config :logger, :console,
  format: {ExJsonLogger, :format},
  metadata: [
    :action,
    :controller,
    :duration,
    :format,
    :method,
    :path,
    :request_id,
    :status
  ]

For additional configuration and metadata option refer to moduledocs

Documentation

Documentation is generated with ExDoc and available online at https://hexdocs.pm/ex_json_logger

  • Logger - For more documentation reference ExJsonLogger
  • Plug - For more documentation reference ExJsonLogger.Plug.Logger
  • Ecto - For more documentation reference ExJsonLogger.Ecto.Logger

Running the tests

Tests include

  • Linter via Credo
  • Coverage via Excoveralls
  • run tests: script/test
  • run tests with coverage: script/test --coverage

Contributing

  • If you modify code, add a corresponding test and documentation(if applicable).
  • Create a Pull Request (please squash to one concise commit).
  • Thanks!

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 99.4%
  • Shell 0.6%