json_logger alternatives and similar packages
Based on the "Logging" category.
Alternatively, view json_logger alternatives based on common mentions on social networks and blogs.
-
timber
Structured logging platform; turns raw text logs into rich structured events. -
logster
Easily parsable single line, plain text and JSON logger for Plug and Phoenix applications -
logger_logstash_backend
Logstash backend for the Elixir Logger -
bunyan
The all-plugins-included package of the Bunyan distributed and pluggable logging system. -
metrix
Elixir library to log custom application metrics, in a well-structured, human and machine readable format, for use by downstream log processing systems (Librato, Reimann, etc...) -
lager_logger
A lager backend that forwards all log messages to Elixir's Logger -
slack_logger_backend
An Elixir logger backend for posting errors to Slack. -
mstore
MStore is a experimental metric store build in erlang, the primary functions are open, new, get and put. -
youtrack_logger_backend
Adding youtrack as a logger backend to your elixir application. -
quiet_logger
A simple plug to suppress health check logging (e.g.: when using Kubernetes).
TestGPT | Generating meaningful tests for busy devs
Do you think we are missing an alternative of json_logger or a related project?
README
Elixir JSON Logger
JSON Logger is a logger backend that outputs elixir logs in JSON format.
This project is originally designed to make Elixir apps work with Logstash easily. It aims at providing as much information for the log is possible, so the logs can be more easily analyzed by backend services like Elasticsearch.
Issues and PRs are welcome.
Dependencies
This project requires json.
Configuration
Elixir Project
JSON Logger currently provides very few options:
- level: The minimal level of logging. There's no default of this option. Example:
level: :warn
- output: The output of the log. Must be either
:console
or{:udp, host, port}
or{:tcp, host, port}. Example:
output: {:udp, "localhost", 514}` - metadata: Whatever else you want in the log. Example:
metadata: "Some very important project"
Example configuration: config :logger, :json_logger, level: :info, output: {:udp, "localhost", 514}
TCP support is still experimental, please submit issues that you encounter.
In your application
You should add json_logger
to your mix.exs
as well. This step may not be necessary (if you know why please tell me).
defmodule MyMod.Mixfile do
# ...
def application do
[applications: [:logger, :json_logger],
mod: {MyMod, []}]
end
# ...
end
Adding the logger backend
You need to add this backend to your Logger
, preferably put this in your Application
's start/2
.
Logger.add_backend Logger.Backends.JSON
If you wish to use Logstash with this library
Here is an example logstash configuration:
input {
udp {
port => 514
type => "elixir_json_logging"
}
}
filter {
json {
source => "message"
}
}
output {
stdout {
codec => rubydebug
}
}
Note that this configuration will probably break on your system (listening to a <1024 port). You should change the "port" to a larger value.