class Azuki::Command::Logs

display logs for an app

Public Instance Methods

drains() click to toggle source

logs:drains

DEPRECATED: use ‘azuki drains`

# File lib/azuki/command/logs.rb, line 40
def drains
  # deprecation notice added 09/30/2011
  display("~ `azuki logs:drains` has been deprecated and replaced with `azuki drains`")
  Azuki::Command::Drains.new.index
end
index() click to toggle source
logs

display recent log output

-n, --num NUM        # the number of lines to display
-p, --ps PS          # only display logs from the given process
-s, --source SOURCE  # only display logs from the given source
-t, --tail           # continually stream logs

Example:

$ azuki logs
2012-01-01T12:00:00+00:00 azuki[api]: Config add EXAMPLE by email@example.com
2012-01-01T12:00:01+00:00 azuki[api]: Release v1 created by email@example.com
# File lib/azuki/command/logs.rb, line 23
def index
  validate_arguments!

  opts = []
  opts << "tail=1"                                 if options[:tail]
  opts << "num=#{options[:num]}"                   if options[:num]
  opts << "ps=#{URI.encode(options[:ps])}"         if options[:ps]
  opts << "source=#{URI.encode(options[:source])}" if options[:source]

  log_displayer = ::Azuki::Helpers::LogDisplayer.new(azuki, app, opts)
  log_displayer.display_logs
end