logger_logstash_backend
logger_logstash_backend copied to clipboard
Problems with Phoenix
I have the following logstash config
# Sample Logstash configuration for receiving
# UDP syslog messages over port 7777
input {
udp {
port => 7777
queue_size => 10000
workers => 10
type => "syslog"
}
}
output {
stdout {}
}
and I configured logger_logstash_backend in phoenix as:
Configures Elixir's Logger
config :logger,
backends: [{LoggerLogstashBackend, :info_log}, :console]
config :logger, :info_log,
host: "127.0.0.1",
port: 7777,
level: :info,
type: "syslog",
metadata: [
extra_fields: "go here"
]
and try to call it like
Logger.info "Here is something: FF"
but I got the error
[error] :gen_event handler {LoggerLogstashBackend, :info_log} installed in Logger terminating
** (MatchError) no match of right hand side value: {:error, :badarg}
(logger_logstash_backend 3.0.0) lib/logger_logstash_backend.ex:61: LoggerLogstashBackend.log_event/5
(logger_logstash_backend 3.0.0) lib/logger_logstash_backend.ex:36: LoggerLogstashBackend.handle_event/2
(stdlib 3.11) gen_event.erl:577: :gen_event.server_update/4
(stdlib 3.11) gen_event.erl:559: :gen_event.server_notify/4
(stdlib 3.11) gen_event.erl:561: :gen_event.server_notify/4
(stdlib 3.11) gen_event.erl:300: :gen_event.handle_msg/6
(stdlib 3.11) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Can you also turn on console logging? The MatchError you're seeing is almost certainly the same general problem as covered in issue #21, i.e. this library can't encode the event to be logged as JSON.