|
| 1 | + |
| 2 | + |
| 3 | +**[↤ Developer Overview](../README.md#developer-overview)** |
| 4 | + |
| 5 | +`sfcc log` |
| 6 | +--- |
| 7 | + |
| 8 | +> Stream/Search log files from an instance |
| 9 | +
|
| 10 | +If you only have a single project, you can run: |
| 11 | + |
| 12 | +```bash |
| 13 | +sfcc log |
| 14 | +``` |
| 15 | + |
| 16 | +If needed to setup multiple clients, or multiple instances for the same client, you will need to specify what to watch: |
| 17 | + |
| 18 | +```bash |
| 19 | +sfcc log <client> <instance> |
| 20 | +``` |
| 21 | + |
| 22 | +**FLAGS:** |
| 23 | + |
| 24 | +Name | Param | Default | Definition |
| 25 | +---------|------------|---------|---------------------------------------------- |
| 26 | +Polling | `-p` | `2` | Polling Interval ( in Seconds ) |
| 27 | +Lines | `-l` | `100` | Number of Existing Lines to Display |
| 28 | +Include | `-i` | | Log Types to Include ( use `sfcc log --list` for list ) |
| 29 | +Exclude | `-e` | | Log Types to Exclude ( use `sfcc log --list` for list ) |
| 30 | +Filter | `-f` | | Filter Log Messages that contain this string or RegExp |
| 31 | +Truncate | `-t` | | Length to Truncate Messages ( if they are too long ) |
| 32 | +List | `--list` | | Output List of Log Types for `-i` & `-e` |
| 33 | +Search | `--search` | `false` | Search Logs with no Live Updates |
| 34 | +Latest | `--latest` | `false` | Show Latest Logs Only ( default is to use ALL logs ) |
| 35 | + |
| 36 | +#### ADVANCED USE: |
| 37 | + |
| 38 | +Get current list of log types: |
| 39 | + |
| 40 | +```bash |
| 41 | +sfcc log list |
| 42 | +``` |
| 43 | + |
| 44 | +Watch latest `customerror` logs that contain the text `PipelineCallServlet`: |
| 45 | + |
| 46 | +```bash |
| 47 | +sfcc log -i customerror -l 5 -f PipelineCallServlet --latest |
| 48 | +``` |
| 49 | + |
| 50 | +View any `warn,error` logs that contain a matching `[0-9]{15}` RegExp pattern, and watch for new entries: |
| 51 | + |
| 52 | +```bash |
| 53 | +sfcc log -i warn,error -f '[0-9]{15}' |
| 54 | +``` |
| 55 | + |
| 56 | +Search all latest existing logs except `staging,syslog` that contain either `WARN|ERROR` RegExp pattern: |
| 57 | + |
| 58 | +```bash |
| 59 | +sfcc log -e staging,syslog -f 'WARN|ERROR' --search --latest |
| 60 | +``` |
0 commit comments