Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Log into aws.emory.edu
  • Enter netid and password
  • Select your proper role for the account, click sign in button
  • Go the services tab and type in CloudWatch
  • Click on the Logs section on the left panel
  • You will be shown the base CloudWatch Logs screen
  • From here you will be able to click on logging "groups"
    • The groups are organized for the type of logs and the "streams" that comprise a group are the instances in which the logs come from
    • Not all groups will have a stream for every instance. For example the fedora_log group doesn't have a stream for curate.library.emory.edu, only for fedora-cor and fedora-cor-test.
  • Click on a group then stream. For example, click on curate_production_log then curate.library.emory.edu
    • This will show a live feed of curate's rails production log. You can search for terms in the search bar above the live feed and set a preferred time in the upper right corner.
    • Scrolling down to the bottom of the feed will refresh the feed and display any new log entries.

Second Method: Awslogs

Awslogs is a python program that retrieve logs from CloudWatch and

...

streams them to a terminal. I believe developers will find this method useful for quickly going through logs. I will briefly go through how to install and run awslogs, please read the full documentation at https://github.com/jorgebastida/awslogs
  • Install awslogs via pip
    • pip install awslogs
  • TKI needs a valid token and AWS_DEFAULT_PROFILE env variable need to be properly set
    • Please review the TKI article in this wiki for knowledge about how to do this.
  • See what groups are available:
    • awslogs groups
  • See what streams are available:
    • awslogs streams messages
      • This will show available streams for the messages log group. Note that if a stream has been inactive for a few days, it will not be shown here. Go to the AWS console if you want a full list of streams.
  • Live feed stream the curate.library production log
    • awslogs get curate_production_log curate.library.emory.edu --watch
      • ctrl-C will break the feed. Note that you can watch both curate and curate-test if you use ALL in place of curate.library, ie awslogs get curate_production_log ALL --watch
  • Get curate.library production logs from the last 2 hours
    • awslogs get curate_production_log curate.l* -s2h
      • Logs will be streamed to your terminal. the -s2h means 'start at -2 hours ago" it could also be 2 days, weeks or seconds.
      • You can use wildcards when referencing streams