Papertrail makes log management easy. It instantly manage logs from many servers.

For intial setup, go through the Getting Started page.

Taking advatage of Elixir logger API, cloud_watch

  • Add cloud_watch to your list of dependencies in mix.exs:
1
2
3
def deps do
  [{:cloud_watch, "~> 0.2.1"}]
end
  • Ensure logger and cloud_watch is started before your application (pre Elixir 1.4):
1
2
3
def application do
  [applications: [:logger, :cloud_watch]]
end
  • Or after Elixir 1.4, just ensure Logger is in extra_applications:
1
2
3
def application do
  [extra_applications: [:logger]]
end

Settings up cloud_watch

  • In your config.exs (or in your #{Mix.env}.exs-files):
1
2
3
4
5
6
7
8
9
config :logger, CloudWatch,
  access_key_id: "",
  secret_access_key: "",
  region: "ap-south-1",
  endpoint: "amazonaws.com",
  log_group_name: "api",
  log_stream_name: "aadya",
  max_buffer_size: 10_485,
  max_timeout: 60_000