Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Phoenix #32

Open
NidalShater opened this issue Mar 27, 2020 · 1 comment
Open

Problems with Phoenix #32

NidalShater opened this issue Mar 27, 2020 · 1 comment

Comments

@NidalShater
Copy link

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
@kenny-evitt
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants