HomePhabricator
Diffusion Scap 2b3bc25baab0

Deploy log tailing/filtering

Authored by dduvall.

Description

Deploy log tailing/filtering

Summary:
The main deploy application now sends all structured log output to a
file under scap/log/{git-tag}.log which the new deploy-log utility
can tail and filter using a given free-form expression. By default the
latter utility will periodically scan the scap/log directory for new
files and immediately begin tailing them. It can also be given an
explicit log file to parse via the --file option or the latest log
file by using --latest; in this case, it will simply filter the entire
file for matching records and exit.

Free-form log.Filter expressions are hopefully simple enough to grok
by most users and general enough to be used with later implementations
of iscap log multiplexing. See deploy-log -h or log.Filter for
expression examples.

Introduced a base main.DeployApplication class which sets up some of
the most commonly referenced attributes of the derived deploy classes,
including the root deploy directory, scap directory, and log directory.

Depends on D15. Resolves T115137

Test Plan:

Tail behavior

  1. Run deploy-log {expr}.
  2. Run deploy in a separate terminal.
  3. Verify that deploy-log in the first terminal starts reading the new log file. It should say -- Opening log file: {file}.
  4. Verify that only log messages matching the given expression are output.

Latest log file behavior

  1. Run deploy.
  2. Run deploy-log -l {expr}
  3. Verify that only log messages from the latest log file matching the given expression are output.

Single log file behavior

  1. Run deploy a couple of times.
  2. Run deploy-log -f {log-file} {expr}.
  3. Verify that only log messages from the given log file matching the given expression are output.

Reviewers: demon, mobrovac, thcipriani, mmodell

Reviewed By: mmodell

Maniphest Tasks: T115137

Differential Revision: https://phabricator.wikimedia.org/D18

Details

Committed
dduvallOct 21 2015, 4:41 PM
Reviewer
mmodell
Differential Revision
D18: Deploy log tailing/filtering
Parents
rMSCA6d1867bce787: Normalize structured logging data
Branches
Unknown
Tags
Unknown
Tasks
T115137: (Re)implement logging output for scap targets
ChangeId
None