https://github.com/operable/adz
A tool for shaping logs
https://github.com/operable/adz
Last synced: about 1 year ago
JSON representation
A tool for shaping logs
- Host: GitHub
- URL: https://github.com/operable/adz
- Owner: operable
- License: other
- Created: 2015-12-16T16:19:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-31T04:17:11.000Z (almost 9 years ago)
- Last Synced: 2025-01-09T02:36:50.829Z (about 1 year ago)
- Language: Elixir
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.MD
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Adz /_ӕdz_/
*NOTE*: Adz is no longer being developed. You should probably just use Elixir's [Logger](https://hexdocs.pm/logger/Logger.html) directly.
1. Noun: A woodworking tool used for smoothing or carving timbers.
1. Noun: A formatting library for Elixir's Logger.
Adz's primary contribution is transparently adding module name and line number to Elixir's Logger output. It can also format logs as valid JSON or plain text.
## Getting adz
Add `adz` to the `deps` section of `mix.exs`:
`{:adz, github: "operable/adz"}`
## Configuring adz output
### JSON
```elixir
config :logger, :console,
metadata: [:module, :line],
format: {Adz, :json}
```
Example output (line breaks and indentation added for readability):
```
{"timestamp":"2016-02-22T13:36:32.0838",
"source":"Cog.Command.RuleCache",
"message":"Ready. Command rule cache TTL is 10 seconds.",
"line":33,
"level":"info"}
```
### Text
```elixir
config :logger, :console,
metadata: [:module, :line],
format: {Adz, :text}
```
Example output:
```
2016-02-22T13:36:32.0838 (Cog.Command.RuleCache:33) [info] Ready. Command rule cache TTL is 10 seconds.
```