 
     System.put_env("_APPSIGNAL_ACTIVE", to_string(config[:active]))
     System.put_env("_APPSIGNAL_AGENT_PATH", List.to_string(:code.priv_dir(:appsignal)))
-    System.put_env("_APPSIGNAL_APP_PATH", List.to_string(:code.priv_dir(:appsignal))) # FIXME - app_path should not be necessary
+    # FIXME - app_path should not be necessary
+    System.put_env("_APPSIGNAL_APP_PATH", List.to_string(:code.priv_dir(:appsignal)))
+
     unless empty?(config[:name]) do
       System.put_env("_APPSIGNAL_APP_NAME", app_name_to_string(config[:name]))
     end
+
     unless empty?(config[:ca_file_path]) do
       System.put_env("_APPSIGNAL_CA_FILE_PATH", config[:ca_file_path])
     end
+
     System.put_env("_APPSIGNAL_DEBUG_LOGGING", to_string(config[:debug]))
+
     unless empty?(config[:dns_servers]) do
       System.put_env("_APPSIGNAL_DNS_SERVERS", config[:dns_servers] |> Enum.join(","))
     end
 
     System.put_env("_APPSIGNAL_ENABLE_HOST_METRICS", to_string(config[:enable_host_metrics]))
     System.put_env("_APPSIGNAL_ENVIRONMENT", to_string(config[:env]))
+
     unless empty?(config[:filter_parameters]) do
       System.put_env("_APPSIGNAL_FILTER_PARAMETERS", config[:filter_parameters] |> Enum.join(","))
     end
+
     System.put_env("_APPSIGNAL_HOSTNAME", config[:hostname])
+
     unless empty?(config[:http_proxy]) do
       System.put_env("_APPSIGNAL_HTTP_PROXY", config[:http_proxy])
     end
+
     System.put_env("_APPSIGNAL_IGNORE_ACTIONS", config[:ignore_actions] |> Enum.join(","))
     System.put_env("_APPSIGNAL_IGNORE_ERRORS", config[:ignore_errors] |> Enum.join(","))
     System.put_env("_APPSIGNAL_IGNORE_NAMESPACES", config[:ignore_namespaces] |> Enum.join(","))
-    System.put_env("_APPSIGNAL_LANGUAGE_INTEGRATION_VERSION", "elixir-" <> @language_integration_version)
+
+    System.put_env(
+      "_APPSIGNAL_LANGUAGE_INTEGRATION_VERSION",
+      "elixir-" <> @language_integration_version
+    )
+
     System.put_env("_APPSIGNAL_LOG", config[:log])
+
     unless empty?(config[:log_path]) do
       System.put_env("_APPSIGNAL_LOG_FILE_PATH", config[:log_path])
     end
+
     System.put_env("_APPSIGNAL_PUSH_API_ENDPOINT", config[:endpoint] || "")
     System.put_env("_APPSIGNAL_PUSH_API_KEY", config[:push_api_key] || "")
+
     unless empty?(config[:running_in_container]) do
       System.put_env("_APPSIGNAL_RUNNING_IN_CONTAINER", to_string(config[:running_in_container]))
     end
+
     System.put_env("_APPSIGNAL_SEND_PARAMS", to_string(config[:send_params]))
+
     unless empty?(config[:working_dir_path]) do
       System.put_env("_APPSIGNAL_WORKING_DIR_PATH", config[:working_dir_path])
     end
+
     unless empty?(config[:files_world_accessible]) do
-      System.put_env("_APPSIGNAL_FILES_WORLD_ACCESSIBLE", to_string(config[:files_world_accessible]))
+      System.put_env(
+        "_APPSIGNAL_FILES_WORLD_ACCESSIBLE",
+        to_string(config[:files_world_accessible])
+      )
     end
   end
 


  defp load_from_environment() do
    %{}
    |> load_environment(@string_keys, &(&1))
    |> load_environment(@bool_keys, &(true?(&1)))
    |> load_environment(@atom_keys, &(String.to_atom(&1)))
    |> load_environment(@string_list_keys, &(String.split(&1, ",")))
  end

  defp coerce_map(value) when is_list(value) do
    value |> Enum.into(%{})
  end
  defp coerce_map(%{} = value) do
    value
  end

    # Make AppSignal active by default if the APPSIGNAL_PUSH_API_KEY
    # environment variable is present.
    # Is overwritten by application config and env config.
    config =
      case System.get_env("APPSIGNAL_PUSH_API_KEY") do
        nil -> config
        _ -> Map.merge(config, %{active: true})
      end

    # Detect Heroku
    case Appsignal.System.heroku?() do
      false -> config
      true -> Map.merge(config, %{running_in_container: true, log: "stdout"})
    end
