Browsing Job Logs

To access logs, you have two options:

Browse Logs using UI

To see the logs for a particular job, you need to select that application from the deployments section, then click on the Logs button in the top right corner of the dashboard.

The logs visible on the dashboard should look similar to the following:

Browse Logs using CLI

We can also see the logs of any application from CLI using the FQN of that application. We can find the application FQN in the dashboard. The following is the command for viewing logs for any application:

sfy logs --application-fqn <Application FQN here>

Filtering Logs

  • --job-run-name <Job Run Name>: Fetches logs from a job run having the given name

    sfy logs --application-fqn <Application FQN here> --job-run-name <Job Run Name>
    
  • --version <Version Number>: Fetches logs from a particular application version

    sfy logs --application-fqn <Application FQN here> --version <Version Number>
    
  • --since <Timestamp or Relative Time>: Time from which you need to see the logs [default = 2 hours]

    sfy logs --application-fqn <Application FQN here> --since <Timestamp / Relative Time>
    

    Timestamp format: --since 2023-04-17T13:39:31.820139+05:30
    Relative time format: --since 2h or --since 80m or --since 4d (h = hours, m = minutes, d = days)

  • --until <Timestamp or Relative Time>: Time until which you need to see the logs

    sfy logs --application-fqn <Application FQN here> --until <Timestamp / Relative Time>
    

    Timestamp format: --until 2023-04-17T13:39:31.820139+05:30
    Relative time format: --until 2h or --until 80m or --until 4d (h = hours, m = minutes, d = days)

  • --follow: Flag to specify whether to follow the log output or not

    sfy logs --application-fqn <Application FQN here> --follow
    
  • --tail <Number> or -n <Number>: Number of logs to tail

    sfy logs --application-fqn <Application FQN here> --tail <num>
    

To see all the options present in CLI, you can use the following command:

sfy logs --help