1
1
import Config
2
2
3
+ config :logger , :default_handler ,
4
+ filters: [
5
+ # Elixir default filter
6
+ remote_gl: { & :logger_filters . remote_gl / 2 , :stop } ,
7
+ # Format trace_id for X-Ray
8
+ opentelemetry_trace_id: { & :opentelemetry_xray_logger_filter . trace_id / 2 , % { } }
9
+ ] ,
10
+ formatter: {
11
+ :logger_formatter_json ,
12
+ % {
13
+ template: [
14
+ :msg ,
15
+ # :time,
16
+ :level ,
17
+ :file ,
18
+ :line ,
19
+ # :mfa,
20
+ :pid ,
21
+ :request_id ,
22
+ :otel_trace_id ,
23
+ :otel_span_id ,
24
+ :otel_trace_flags ,
25
+ :xray_trace_id ,
26
+ :rest
27
+ ]
28
+ }
29
+
30
+ # ## SSL Support
31
+ #
32
+ # In order to use HTTPS in development, a self-signed
33
+ # certificate can be generated by running the following
34
+ # Mix task:
35
+ #
36
+ # mix phx.gen.cert
37
+ #
38
+ # Run `mix help phx.gen.cert` for more information.
39
+ #
40
+ # The `http:` config above can be replaced with:
41
+ #
42
+ # https: [
43
+ # port: 4001,
44
+ # cipher_suite: :strong,
45
+ }
46
+
47
+ config :logger ,
48
+ level: :debug ,
49
+ always_evaluate_messages: true
50
+
3
51
config :phoenix_container_example , PhoenixContainerExample.Repo ,
4
52
username: System . get_env ( "DATABASE_USER" ) || "postgres" ,
5
53
password: System . get_env ( "DATABASE_PASS" ) || "postgres" ,
@@ -11,8 +59,18 @@ config :phoenix_container_example, PhoenixContainerExample.Repo,
11
59
12
60
config :phoenix_container_example , PhoenixContainerExampleWeb.Endpoint ,
13
61
# Binding to loopback ipv4 address prevents access from other machines.
62
+ # keyfile: "priv/cert/selfsigned_key.pem",
63
+
14
64
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
65
+ # certfile: "priv/cert/selfsigned.pem"
66
+
15
67
# http: [ip: {127, 0, 0, 1}, port: 4000],
68
+ # ],
69
+ #
70
+ # If desired, both `http:` and `https:` keys can be
71
+ # configured to run both http and https servers on
72
+ # different ports.
73
+
16
74
http: [ port: String . to_integer ( System . get_env ( "PORT" ) || "4000" ) ] ,
17
75
check_origin: false ,
18
76
code_reloader: true ,
@@ -23,29 +81,6 @@ config :phoenix_container_example, PhoenixContainerExampleWeb.Endpoint,
23
81
tailwind: { Tailwind , :install_and_run , [ :default , ~w( --watch) ] }
24
82
]
25
83
26
- # ## SSL Support
27
- #
28
- # In order to use HTTPS in development, a self-signed
29
- # certificate can be generated by running the following
30
- # Mix task:
31
- #
32
- # mix phx.gen.cert
33
- #
34
- # Run `mix help phx.gen.cert` for more information.
35
- #
36
- # The `http:` config above can be replaced with:
37
- #
38
- # https: [
39
- # port: 4001,
40
- # cipher_suite: :strong,
41
- # keyfile: "priv/cert/selfsigned_key.pem",
42
- # certfile: "priv/cert/selfsigned.pem"
43
- # ],
44
- #
45
- # If desired, both `http:` and `https:` keys can be
46
- # configured to run both http and https servers on
47
- # different ports.
48
-
49
84
# Watch static and templates for browser reloading.
50
85
config :phoenix_container_example , PhoenixContainerExampleWeb.Endpoint ,
51
86
live_reload: [
@@ -59,42 +94,10 @@ config :phoenix_container_example, PhoenixContainerExampleWeb.Endpoint,
59
94
# Enable dev routes for dashboard and mailbox
60
95
config :phoenix_container_example , dev_routes: true
61
96
62
- config :logger ,
63
- level: :debug ,
64
- always_evaluate_messages: true
65
-
66
97
# config :logger, :default_formatter,
67
98
# format: "$time $metadata[$level] $message\n",
68
99
# metadata: [:file, :line]
69
100
70
- config :logger , :default_handler ,
71
- filters: [
72
- # Elixir default filter
73
- remote_gl: { & :logger_filters . remote_gl / 2 , :stop } ,
74
- # Format trace_id for X-Ray
75
- opentelemetry_trace_id: { & :opentelemetry_xray_logger_filter . trace_id / 2 , % { } }
76
- ] ,
77
- formatter: {
78
- :logger_formatter_json ,
79
- % {
80
- template: [
81
- :msg ,
82
- # :time,
83
- :level ,
84
- :file ,
85
- :line ,
86
- # :mfa,
87
- :pid ,
88
- :request_id ,
89
- :otel_trace_id ,
90
- :otel_span_id ,
91
- :otel_trace_flags ,
92
- :xray_trace_id ,
93
- :rest
94
- ]
95
- }
96
- }
97
-
98
101
if System . get_env ( "OTEL_DEBUG" ) == "true" do
99
102
config :opentelemetry , :processors ,
100
103
otel_batch_processor: % {
@@ -104,13 +107,13 @@ else
104
107
config :opentelemetry , traces_exporter: :none
105
108
end
106
109
110
+ # Initialize plugs at runtime for faster development compilation
111
+ config :phoenix , :plug_init_mode , :runtime
112
+
107
113
# Set a higher stacktrace during development. Avoid configuring such
108
114
# in production as building large stacktraces may be expensive.
109
115
config :phoenix , :stacktrace_depth , 20
110
116
111
- # Initialize plugs at runtime for faster development compilation
112
- config :phoenix , :plug_init_mode , :runtime
113
-
114
117
# Include HEEx debug annotations as HTML comments in rendered markup
115
118
config :phoenix_live_view , debug_heex_annotations: true
116
119
0 commit comments