Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add logs command to view/tail Nginx log files #337

Merged
merged 2 commits into from
Dec 28, 2022
Merged

Conversation

swalkinshaw
Copy link
Member

@swalkinshaw swalkinshaw commented Nov 17, 2022

Closes #5

Usage: trellis logs [options] ENVIRONMENT [SITE]

Tails the Nginx log files for an environment.

Automatically integrates with https://goaccess.io/ when the --goaccess option is used.

View production logs:

  $ trellis logs production

View access logs only:

  $ trellis logs --access production

View error logs only:

  $ trellis logs --error production

View logs in goaccess:

  $ trellis logs --goaccess production

Pass flags to goaccess:

  $ trellis logs --goaccess-flags="-a -m" production

View the last 50 log lines (-n corresponds to tail's -n option):

  $ trellis logs -n 50 production

Arguments:
  ENVIRONMENT Name of environment (ie: production)
  SITE        Name of site (ie: example.com)
  
Options:
      --access          Show access logs only
      --error           Show error logs only
  -g, --goaccess        Uses goaccess as the log viewer instead of tail
      --goaccess-flags  Flags to pass to the goaccess command (in quotes)
  -n, --number          Location (number lines) corresponding to tail's '-n' argument
  -h, --help            Show this help

@swalkinshaw swalkinshaw marked this pull request as ready for review November 18, 2022 03:55
@swalkinshaw swalkinshaw merged commit b4244a4 into master Dec 28, 2022
@swalkinshaw swalkinshaw deleted the logs-command branch December 28, 2022 17:32
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log command
1 participant