I'm presently building out an API using the phoenix framework v1.3 rc1 and everything works as intended on my local dev environment, but when I pushed the changes to a production box to test the API the phx app is returning 500 Internal Server Error. I'm trying to setup logging for the dev / prod environments using logger_file_backend
by following the instructions on the github page, but I'm not seeing any log files being generated in the dev or prod environments.
config.exs
# Configures Elixir's Logger
config :logger, :console,
backends: [{LoggerFileBackend, :error_log}]
# format: "$time $metadata[$level] $message\n",
# metadata: [:request_id]
# configuration for the {LoggerFileBackend, :error_log} backend
config :logger, :error_log,
path: "/home/deploy/deployments/kegcopr_api/error.log",
level: :error
prod.exs
# Do not print debug messages in production
# config :logger, level: :info
config :logger, format: "[$level] $message\n",
backends: [{LoggerFileBackend, :error_log}, :console]
config :logger, :error_log,
path: "/home/deploy/deployments/kegcopr_api/error.log",
level: :error
dev.exs
# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n",
backends: [{LoggerFileBackend, :error_log}, :console]
config :logger, :error_log,
path: "/opt/elixir/kegcopr_api/log/error.log",
level: :debug
bin/my_app console
. – Steve Pallengatling
which apparently does not play nice with the command you suggested. – ipatchbin/my_app stop
and thenbin/my_app console
. You should then see the error messages in the console. – Steve Pallen