1
votes

I have an elixir mix project and I am not sure how to configure log format. Below is my configuration:

config :logger, backends: [{LoggerFileBackend, :error_log}], format: "$date $time [$level] $levelpad$message\n"

what I want is to show date, time level in the log file but the log doesn't have date:

15:49:06.384 [info] The Sample is launching: /users/joeyzhao/dev/test1. In space, no one can hear. 15:49:06.384 [info] Elixer version: (1.6.5) 15:49:06.397 [info] Environment ...

I use below code to log:

require Logger ... Logger.info("...")

Is there anything wrong with my logger config?

1

1 Answers

0
votes

That’s the drawback of configuration being loaded on compilation time. You have to recompile logger_file_backend to reflect changes in your app’s configuration files.