HostFn

hostfn logs

View application logs from the server.

Usage

hostfn logs [environment] [options]

Arguments

ArgumentDescriptionDefault
environmentEnvironmentproduction

Options

OptionDescriptionDefault
--lines <n>Number of lines to show100
--errorsShow only error linesfalse
--output <file>Save logs to a local file
--service <name>View logs for specific monorepo service

Description

Retrieves PM2 logs from the remote server. Logs are streamed to your terminal in real-time unless --output is specified.

Error Filtering

The --errors flag filters output to only show lines containing: error, Error, ERROR, fail, Fail, FAIL, exception, or Exception.

Monorepo

For monorepo deployments, you must specify --service:

hostfn logs production --service api

Examples

# View last 100 lines of production logs
hostfn logs production

# View last 500 lines
hostfn logs production --lines 500

# View only errors
hostfn logs production --errors

# Save logs to file
hostfn logs production --output app.log

# View specific monorepo service logs
hostfn logs production --service api