use new Logger module
This commit is contained in:
parent
52838bcdc7
commit
ce223b76db
6 changed files with 38 additions and 6 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -49,3 +49,6 @@ npm-debug.log
|
||||||
|
|
||||||
# elixir ls
|
# elixir ls
|
||||||
.elixir_ls
|
.elixir_ls
|
||||||
|
|
||||||
|
# log files
|
||||||
|
/*.log
|
|
@ -43,9 +43,30 @@ config :tailwind,
|
||||||
]
|
]
|
||||||
|
|
||||||
# Configures Elixir's Logger
|
# Configures Elixir's Logger
|
||||||
config :logger, :console,
|
config :logger, :default_handler,
|
||||||
format: "$time $metadata[$level] $message\n",
|
level: :debug
|
||||||
metadata: [:request_id]
|
|
||||||
|
config :logger, :default_formatter,
|
||||||
|
format: "$time $metadata[$level] $message\n"
|
||||||
|
|
||||||
|
config :chiya, :logger, [
|
||||||
|
{:handler, :file_log, :logger_std_h, %{
|
||||||
|
level: :info,
|
||||||
|
config: %{
|
||||||
|
file: ~c"chiya.log",
|
||||||
|
filesync_repeat_interval: 5000,
|
||||||
|
file_check: 5000,
|
||||||
|
max_no_bytes: 10_000_000,
|
||||||
|
max_no_files: 5,
|
||||||
|
compress_on_rotate: true
|
||||||
|
},
|
||||||
|
formatter: Logger.Formatter.new()
|
||||||
|
}}
|
||||||
|
]
|
||||||
|
|
||||||
|
# config :logger, :console,
|
||||||
|
# format: "$time $metadata[$level] $message\n",
|
||||||
|
# metadata: [:request_id]
|
||||||
|
|
||||||
# Use Jason for JSON parsing in Phoenix
|
# Use Jason for JSON parsing in Phoenix
|
||||||
config :phoenix, :json_library, Jason
|
config :phoenix, :json_library, Jason
|
||||||
|
|
|
@ -66,7 +66,9 @@ config :chiya, ChiyaWeb.Endpoint,
|
||||||
config :chiya, dev_routes: true
|
config :chiya, dev_routes: true
|
||||||
|
|
||||||
# Do not include metadata nor timestamps in development logs
|
# Do not include metadata nor timestamps in development logs
|
||||||
config :logger, :console, format: "[$level] $message\n"
|
# config :logger, :console, format: "[$level] $message\n"
|
||||||
|
config :logger, :default_formatter,
|
||||||
|
format: "[$level] $message\n"
|
||||||
|
|
||||||
# Set a higher stacktrace during development. Avoid configuring such
|
# Set a higher stacktrace during development. Avoid configuring such
|
||||||
# in production as building large stacktraces may be expensive.
|
# in production as building large stacktraces may be expensive.
|
||||||
|
|
|
@ -15,7 +15,9 @@ config :chiya, ChiyaWeb.Endpoint, cache_static_manifest: "priv/static/cache_mani
|
||||||
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: Chiya.Finch
|
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: Chiya.Finch
|
||||||
|
|
||||||
# Do not print debug messages in production
|
# Do not print debug messages in production
|
||||||
config :logger, level: :debug
|
# config :logger, level: :debug
|
||||||
|
config :logger, :default_handler,
|
||||||
|
level: :info
|
||||||
|
|
||||||
config :cors_plug,
|
config :cors_plug,
|
||||||
origin: ["app://obsidian.md"],
|
origin: ["app://obsidian.md"],
|
||||||
|
|
|
@ -30,7 +30,9 @@ config :chiya, Chiya.Mailer, adapter: Swoosh.Adapters.Test
|
||||||
config :swoosh, :api_client, false
|
config :swoosh, :api_client, false
|
||||||
|
|
||||||
# Print only warnings and errors during test
|
# Print only warnings and errors during test
|
||||||
config :logger, level: :warning
|
# config :logger, level: :warning
|
||||||
|
config :logger, :default_handler,
|
||||||
|
level: :warning
|
||||||
|
|
||||||
# Initialize plugs at runtime for faster test compilation
|
# Initialize plugs at runtime for faster test compilation
|
||||||
config :phoenix, :plug_init_mode, :runtime
|
config :phoenix, :plug_init_mode, :runtime
|
||||||
|
|
|
@ -24,6 +24,8 @@ defmodule Chiya.Application do
|
||||||
# {Chiya.Worker, arg}
|
# {Chiya.Worker, arg}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Logger.add_handlers(:chiya)
|
||||||
|
|
||||||
# See https://hexdocs.pm/elixir/Supervisor.html
|
# See https://hexdocs.pm/elixir/Supervisor.html
|
||||||
# for other strategies and supported options
|
# for other strategies and supported options
|
||||||
opts = [strategy: :one_for_one, name: Chiya.Supervisor]
|
opts = [strategy: :one_for_one, name: Chiya.Supervisor]
|
||||||
|
|
Loading…
Reference in a new issue