Skip to content
No description, website, or topics provided.
Branch: develop
Clone or download
toddboom Merge pull request #43 from cloudfoundry/tp-jr-fix-installation-instr…
…uctions

Clarify installation instructions for plugin and update output for `cf tail -h`
Latest commit 0dc5b34 Jan 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd
docs
pkg/command display error message when log-cache API does not support name-filter… Jan 23, 2019
scripts
.gitignore
.travis.yml
LICENSE Add license and notice Nov 29, 2017
NOTICE
README.md Update cf tail -h output to latest Jan 23, 2019
go.mod
go.sum

README.md

Log Cache CLI

GoDoc travis slack.cloudfoundry.org

The Log Cache CLI can be installed and used in two ways.

  • Standalone CLI for Log Cache
  • Cloud Foundry CLI plugin for Log Cache

Cloud Foundry CLI plugin

The Log Cache CLI Plugin is a CF CLI plugin for the Log Cache system.

Plugin Demo

Installing Plugin

The CF plugin is available in the CF-Community repo:

cf install-plugin -r CF-Community "log-cache"

Or, you can download a pre-built binary from GitHub:

# Linux
wget https://github.com/cloudfoundry/log-cache-cli/releases/download/v2.1.0/log-cache-cf-plugin-linux
cf install-plugin -f log-cache-cf-plugin-linux

# OSX
wget https://github.com/cloudfoundry/log-cache-cli/releases/download/v2.1.0/log-cache-cf-plugin-darwin
cf install-plugin -f log-cache-cf-plugin-darwin

# Windows
wget https://github.com/cloudfoundry/log-cache-cli/releases/download/v2.1.0/log-cache-cf-plugin-windows
cf install-plugin -f log-cache-cf-plugin-windows

Alternatively, you can build from source:

git clone git@github.com:cloudfoundry/log-cache-cli.git
cd log-cache-cli
scripts/install.sh

Usage

$ cf tail --help
NAME:
   tail - Output logs for a source-id/app

USAGE:
   tail [options] <source-id/app>

ENVIRONMENT VARIABLES:
   LOG_CACHE_ADDR       Overrides the default location of log-cache.
   LOG_CACHE_SKIP_AUTH  Set to 'true' to disable CF authentication.

OPTIONS:
   --start-time               Start of query range in UNIX nanoseconds.
   --end-time                 End of query range in UNIX nanoseconds.
   --follow, -f               Output appended to stdout as logs are egressed.
   --lines, -n                Number of envelopes to return. Default is 10.
   --envelope-class, -c       Envelope class filter. Available filters: 'logs', 'metrics', and 'any'.
   --envelope-type, -t        Envelope type filter. Available filters: 'log', 'counter', 'gauge', 'timer', 'event', and 'any'.
   --json                     Output envelopes in JSON format.
   --name-filter              Filters metrics by name.
   --new-line                 Character used for new line substition, must be single unicode character. Default is '\n'.
$ cf log-meta --help
NAME:
   log-meta - Show all available meta information

USAGE:
   log-meta [options]

ENVIRONMENT VARIABLES:
   LOG_CACHE_ADDR       Overrides the default location of log-cache.
   LOG_CACHE_SKIP_AUTH  Set to 'true' to disable CF authentication.

OPTIONS:
   --guid              Display raw source GUIDs
   --noise             Fetch and display the rate of envelopes per minute for the last minute. WARNING: This is slow...
   --sort-by           Sort by specified column. Available: 'source-id', 'source', 'source-type', 'count', 'expired', 'cache-duration', and 'rate'.
   --source-type       Source type of information to show. Available: 'all', 'application', and 'platform'.

Stand alone CLI

Installing CLI

You can download a pre-built binary from GitHub:

# Linux
wget https://github.com/cloudfoundry/log-cache-cli/releases/download/v2.1.0/log-cache-linux

# OSX
wget https://github.com/cloudfoundry/log-cache-cli/releases/download/v2.1.0/log-cache-darwin

# Windows
wget https://github.com/cloudfoundry/log-cache-cli/releases/download/v2.1.0/log-cache-windows

Alternatively, you can build from source:

git clone git@github.com:cloudfoundry/log-cache-cli.git
cd log-cache-cli
scripts/install.sh

Usage

  1. Target the Log Cache by setting the environment variable LOG_CACHE_ADDR.
  2. Simply run the log-cache command to view current metrics stored in Log Cache.
  3. Help can be accessed with the --help flag at any command level.
$ log-cache tail --help
Output logs and metrics for a given source-id

Usage:
  log-cache tail <source-id> [flags]

Flags:
  -f, --follow   Output appended to stdout as logs are egressed.
  -h, --help     help for tail
You can’t perform that action at this time.