mirror of
https://github.com/valitydev/pathfinder.git
synced 2024-11-06 09:45:24 +00:00
Env-based configs (#2)
This commit is contained in:
parent
0ec747d87b
commit
526ad6edda
@ -1,35 +1,10 @@
|
||||
import Config
|
||||
|
||||
config :pathfinder, Woody.Server,
|
||||
ip: "0.0.0.0",
|
||||
port: 8022
|
||||
# Common compile-time app env
|
||||
|
||||
config :pathfinder, ecto_repos: [NewWay.Repo]
|
||||
|
||||
config :pathfinder, NewWay.Repo,
|
||||
database: "nw",
|
||||
username: "postgres",
|
||||
password: "postgres",
|
||||
hostname: "postgres"
|
||||
|
||||
config :pathfinder, :logger, [
|
||||
{:handler, :default, :logger_std_h, %{
|
||||
:config => %{
|
||||
:type => {:file, 'console.json'}
|
||||
},
|
||||
:formatter => {:logger_logstash_formatter, %{
|
||||
:exclude_meta_fields => [:ansi_color, :application, :file, :line, :mfa, :pid, :gl, :domain]
|
||||
}}
|
||||
}},
|
||||
{:handler, Logger, :logger_std_h, %{
|
||||
:config => %{
|
||||
:type => {:file, 'console.json'}
|
||||
},
|
||||
:formatter => {:logger_logstash_formatter, %{
|
||||
:exclude_meta_fields => [:ansi_color, :application, :file, :line, :mfa, :pid, :gl, :domain]
|
||||
}}
|
||||
}}
|
||||
]
|
||||
|
||||
# Dont use Elixir's logger
|
||||
config :logger, backends: []
|
||||
|
||||
import_config("#{Mix.env()}.exs")
|
||||
|
32
config/dev.exs
Normal file
32
config/dev.exs
Normal file
@ -0,0 +1,32 @@
|
||||
import Config
|
||||
|
||||
# Development compile-time app env
|
||||
|
||||
config :pathfinder, Woody.Server,
|
||||
ip: "0.0.0.0",
|
||||
port: 8022
|
||||
|
||||
config :pathfinder, NewWay.Repo,
|
||||
database: "nw",
|
||||
username: "postgres",
|
||||
password: "postgres",
|
||||
hostname: "postgres"
|
||||
|
||||
config :pathfinder, :logger, [
|
||||
{:handler, :default, :logger_std_h, %{
|
||||
:config => %{
|
||||
:type => {:file, 'console.json'}
|
||||
},
|
||||
:formatter => {:logger_logstash_formatter, %{
|
||||
:exclude_meta_fields => [:ansi_color, :application, :file, :line, :mfa, :pid, :gl, :domain]
|
||||
}}
|
||||
}},
|
||||
{:handler, Logger, :logger_std_h, %{
|
||||
:config => %{
|
||||
:type => {:file, 'console.json'}
|
||||
},
|
||||
:formatter => {:logger_logstash_formatter, %{
|
||||
:exclude_meta_fields => [:ansi_color, :application, :file, :line, :mfa, :pid, :gl, :domain]
|
||||
}}
|
||||
}}
|
||||
]
|
6
config/prod.exs
Normal file
6
config/prod.exs
Normal file
@ -0,0 +1,6 @@
|
||||
import Config
|
||||
|
||||
# Production compile-time app env
|
||||
|
||||
config :pathfinder, NewWay.Repo,
|
||||
show_sensitive_data_on_connection_error: :false
|
@ -1,30 +1,3 @@
|
||||
import Config
|
||||
|
||||
config :pathfinder, Woody.Server,
|
||||
ip: "0.0.0.0",
|
||||
port: 8022
|
||||
|
||||
config :pathfinder, NewWay.Repo,
|
||||
database: "nw",
|
||||
username: "postgres",
|
||||
password: "postgres",
|
||||
hostname: "postgres"
|
||||
|
||||
config :pathfinder, :logger, [
|
||||
{:handler, :default, :logger_std_h, %{
|
||||
:config => %{
|
||||
:type => {:file, 'console.json'}
|
||||
},
|
||||
:formatter => {:logger_logstash_formatter, %{
|
||||
:exclude_meta_fields => [:ansi_color, :application, :file, :line, :mfa, :pid, :gl, :domain]
|
||||
}}
|
||||
}},
|
||||
{:handler, Logger, :logger_std_h, %{
|
||||
:config => %{
|
||||
:type => {:file, 'console.json'}
|
||||
},
|
||||
:formatter => {:logger_logstash_formatter, %{
|
||||
:exclude_meta_fields => [:ansi_color, :application, :file, :line, :mfa, :pid, :gl, :domain]
|
||||
}}
|
||||
}}
|
||||
]
|
||||
# Configure release environment here
|
||||
|
5
config/test.exs
Normal file
5
config/test.exs
Normal file
@ -0,0 +1,5 @@
|
||||
import Config
|
||||
|
||||
# Test compile-time app env
|
||||
|
||||
import_config("dev.exs")
|
Loading…
Reference in New Issue
Block a user