Skip to content

Commit

Permalink
Adding customized access log
Browse files Browse the repository at this point in the history
  • Loading branch information
houshuang committed Jul 1, 2015
1 parent 8ba12b8 commit 2cdeac5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Empty file added log/_empty
Empty file.
6 changes: 4 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule Survey.Mixfile do
def application do
[mod: {Survey, []},
applications: [:phoenix, :phoenix_html, :cowboy, :logger,
:phoenix_ecto, :postgrex, :dogstatsd, :httpoison]]
:phoenix_ecto, :postgrex, :dogstatsd, :httpoison, :plug_accesslog ]]
end

# Specifies which paths to compile per environment
Expand All @@ -43,7 +43,9 @@ defmodule Survey.Mixfile do
{:dogstatsd, "0.0.3"},
{:exprintf, github: "parroty/exprintf"},
{:param_session, github: "houshuang/param_session"},
{:csv, "~> 1.0.0"}
{:csv, "~> 1.0.0"},
{:plug_accesslog, github: "houshuang/plug_accesslog_survey"}
# {:plug_accesslog, github: "houshuang/plug_accesslog"}
]
end
end
9 changes: 9 additions & 0 deletions web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ defmodule Survey.Router do
pipeline :browser do
plug ParamSession
plug EnsureLti
plug Plug.AccessLog,
format: :clf,
file: "log/access_log"
plug :accepts, ["html"]
plug :fetch_flash
plug EnsureRegistered
Expand All @@ -14,6 +17,9 @@ defmodule Survey.Router do
pipeline :register do
plug ParamSession
plug EnsureLti
plug Plug.AccessLog,
format: :clf,
file: "log/access_log"
plug :accepts, ["html"]
plug :fetch_flash
end
Expand All @@ -25,6 +31,9 @@ defmodule Survey.Router do
signing_salt: "LMvTyOc2"
plug :fetch_session
plug VerifyAdmin
plug Plug.AccessLog,
format: :clf,
file: "log/access_log"
plug :fetch_flash
plug :accepts, ["html"]
end
Expand Down

0 comments on commit 2cdeac5

Please sign in to comment.