Skip to content

Commit

Permalink
Merge pull request #591 from zapier/update-logging-info
Browse files Browse the repository at this point in the history
[SUPPORTENG-520] docs(cli): Update logging info
  • Loading branch information
armchairlinguist committed Nov 28, 2022
2 parents feb2245 + 3aa18ea commit c50f0f2
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 20 deletions.
21 changes: 17 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4179,7 +4179,11 @@ <h2 id="logging">Logging</h2>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>There are two types of logs for a Zapier app, console logs and HTTP logs. The console logs are created by your app through the use of the <code>z.console.log</code> method (<a href="#console-logging">see below for details</a>). The HTTP logs are created automatically by Zapier whenever your app makes HTTP requests (as long as you use <code>z.request([url], options)</code> or shorthand request objects).</p><p>To view the logs for your application, use the <code>zapier logs</code> command. There are three types of logs, <code>http</code> (logged automatically by Zapier on HTTP requests), <code>bundle</code> (logged automatically on every method execution), and <code>console</code> (manual logs via <code>z.console.log()</code> statements).</p><p>For advanced logging options including only displaying the logs for a certain user or app version, look at the help for the logs command:</p>
<p>To view the logs for your application, use the <code>zapier logs</code> command.</p><p>There are three types of logs for a Zapier app:</p><ul>
<li><code>http</code>: logged automatically by Zapier on HTTP requests</li>
<li><code>bundle</code>: logged automatically on every method execution</li>
<li><code>console</code>: manual logs via <code>z.console.log()</code> statements (<a href="#console-logging">see below for details</a>)</li>
</ul><p>For advanced logging options, including only displaying the logs for a certain user or app version, look at the help for the logs command:</p>
</div>
<div class="col-md-7 col-sm-12 col-height docs-code">
<pre><code class="lang-bash">zapier <span class="hljs-built_in">help</span> logs
Expand Down Expand Up @@ -4208,7 +4212,7 @@ <h3 id="console-logging">Console Logging</h3>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>The <code>z.console</code> object has all the same methods and works just like the Node.js <a href="https://nodejs.org/docs/latest-v6.x/api/console.html"><code>Console</code></a> class - the only difference is we&apos;ll log to our distributed datastore and you can view them via <code>zapier logs</code> (more below).</p>
<p>The <code>z.console</code> object has all the same methods and works just like the Node.js <a href="https://nodejs.org/docs/latest-v14.x/api/console.html"><code>Console</code></a> class - the only difference is we&apos;ll log to our distributed datastore and you can view the logs via <code>zapier logs</code> (more below).</p>
</div>
<div class="col-md-7 col-sm-12 col-height is-empty docs-code">

Expand Down Expand Up @@ -4264,7 +4268,7 @@ <h3 id="http-logging">HTTP Logging</h3>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>If you are using the <code>z.request()</code> shortcut that we provide - HTTP logging is handled automatically for you. For example:</p>
<p>If you are using <a href="#shorthand-http-requests">shorthand HTTP requests</a> or the <code>z.request()</code> method that we provide, HTTP logging is handled automatically for you. For example:</p>
</div>
<div class="col-md-7 col-sm-12 col-height docs-code">
<pre><code class="lang-js">z.request(<span class="hljs-string">&apos;https://57b20fb546b57d1100a3c405.mockapi.io/api/recipes&apos;</span>)
Expand All @@ -4276,6 +4280,15 @@ <h3 id="http-logging">HTTP Logging</h3>
</div>
</div>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>HTTP logging will often work with other methods of making requests as well, but if you&apos;re using another method and having trouble seeing logs, try using <code>z.request()</code>.</p>
</div>
<div class="col-md-7 col-sm-12 col-height is-empty docs-code">

</div>
</div>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<h3 id="viewing-http-logs">Viewing HTTP Logs</h3>
Expand All @@ -4297,7 +4310,7 @@ <h3 id="viewing-http-logs">Viewing HTTP Logs</h3>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>To see detailed http logs including headers, request and response bodies, etc, do:</p>
<p>To see detailed HTTP logs, including data such as headers and request and response bodies, do:</p>
</div>
<div class="col-md-7 col-sm-12 col-height docs-code">
<pre><code class="lang-bash">zapier logs --<span class="hljs-built_in">type</span>=http --detailed
Expand Down
18 changes: 12 additions & 6 deletions packages/cli/README-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -1400,11 +1400,15 @@ See a full example with dehydration/hydration wired in correctly:

## Logging

There are two types of logs for a Zapier app, console logs and HTTP logs. The console logs are created by your app through the use of the `z.console.log` method ([see below for details](#console-logging)). The HTTP logs are created automatically by Zapier whenever your app makes HTTP requests (as long as you use `z.request([url], options)` or shorthand request objects).
To view the logs for your application, use the `zapier logs` command.

To view the logs for your application, use the `zapier logs` command. There are three types of logs, `http` (logged automatically by Zapier on HTTP requests), `bundle` (logged automatically on every method execution), and `console` (manual logs via `z.console.log()` statements).
There are three types of logs for a Zapier app:

For advanced logging options including only displaying the logs for a certain user or app version, look at the help for the logs command:
* `http`: logged automatically by Zapier on HTTP requests
* `bundle`: logged automatically on every method execution
* `console`: manual logs via `z.console.log()` statements ([see below for details](#console-logging))

For advanced logging options, including only displaying the logs for a certain user or app version, look at the help for the logs command:

```bash
zapier help logs
Expand All @@ -1418,7 +1422,7 @@ To manually print a log statement in your code, use `z.console.log`:
z.console.log('Here are the input fields', bundle.inputData);
```

The `z.console` object has all the same methods and works just like the Node.js [`Console`](https://nodejs.org/docs/latest-v6.x/api/console.html) class - the only difference is we'll log to our distributed datastore and you can view them via `zapier logs` (more below).
The `z.console` object has all the same methods and works just like the Node.js [`Console`](https://nodejs.org/docs/latest-v14.x/api/console.html) class - the only difference is we'll log to our distributed datastore and you can view the logs via `zapier logs` (more below).

### Viewing Console Logs

Expand All @@ -1438,7 +1442,7 @@ zapier logs --type=bundle

### HTTP Logging

If you are using the `z.request()` shortcut that we provide - HTTP logging is handled automatically for you. For example:
If you are using [shorthand HTTP requests](#shorthand-http-requests) or the `z.request()` method that we provide, HTTP logging is handled automatically for you. For example:

```js
z.request('https://57b20fb546b57d1100a3c405.mockapi.io/api/recipes')
Expand All @@ -1448,14 +1452,16 @@ z.request('https://57b20fb546b57d1100a3c405.mockapi.io/api/recipes')
})
```

HTTP logging will often work with other methods of making requests as well, but if you're using another method and having trouble seeing logs, try using `z.request()`.

### Viewing HTTP Logs

To see the HTTP logs, do:

```bash
zapier logs --type=http
```
To see detailed http logs including headers, request and response bodies, etc, do:
To see detailed HTTP logs, including data such as headers and request and response bodies, do:

```bash
zapier logs --type=http --detailed
Expand Down
18 changes: 12 additions & 6 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2553,11 +2553,15 @@ module.exports = App;

## Logging

There are two types of logs for a Zapier app, console logs and HTTP logs. The console logs are created by your app through the use of the `z.console.log` method ([see below for details](#console-logging)). The HTTP logs are created automatically by Zapier whenever your app makes HTTP requests (as long as you use `z.request([url], options)` or shorthand request objects).
To view the logs for your application, use the `zapier logs` command.

To view the logs for your application, use the `zapier logs` command. There are three types of logs, `http` (logged automatically by Zapier on HTTP requests), `bundle` (logged automatically on every method execution), and `console` (manual logs via `z.console.log()` statements).
There are three types of logs for a Zapier app:

For advanced logging options including only displaying the logs for a certain user or app version, look at the help for the logs command:
* `http`: logged automatically by Zapier on HTTP requests
* `bundle`: logged automatically on every method execution
* `console`: manual logs via `z.console.log()` statements ([see below for details](#console-logging))

For advanced logging options, including only displaying the logs for a certain user or app version, look at the help for the logs command:

```bash
zapier help logs
Expand All @@ -2571,7 +2575,7 @@ To manually print a log statement in your code, use `z.console.log`:
z.console.log('Here are the input fields', bundle.inputData);
```

The `z.console` object has all the same methods and works just like the Node.js [`Console`](https://nodejs.org/docs/latest-v6.x/api/console.html) class - the only difference is we'll log to our distributed datastore and you can view them via `zapier logs` (more below).
The `z.console` object has all the same methods and works just like the Node.js [`Console`](https://nodejs.org/docs/latest-v14.x/api/console.html) class - the only difference is we'll log to our distributed datastore and you can view the logs via `zapier logs` (more below).

### Viewing Console Logs

Expand All @@ -2591,7 +2595,7 @@ zapier logs --type=bundle

### HTTP Logging

If you are using the `z.request()` shortcut that we provide - HTTP logging is handled automatically for you. For example:
If you are using [shorthand HTTP requests](#shorthand-http-requests) or the `z.request()` method that we provide, HTTP logging is handled automatically for you. For example:

```js
z.request('https://57b20fb546b57d1100a3c405.mockapi.io/api/recipes')
Expand All @@ -2601,14 +2605,16 @@ z.request('https://57b20fb546b57d1100a3c405.mockapi.io/api/recipes')
})
```

HTTP logging will often work with other methods of making requests as well, but if you're using another method and having trouble seeing logs, try using `z.request()`.

### Viewing HTTP Logs

To see the HTTP logs, do:

```bash
zapier logs --type=http
```
To see detailed http logs including headers, request and response bodies, etc, do:
To see detailed HTTP logs, including data such as headers and request and response bodies, do:

```bash
zapier logs --type=http --detailed
Expand Down
21 changes: 17 additions & 4 deletions packages/cli/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4179,7 +4179,11 @@ <h2 id="logging">Logging</h2>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>There are two types of logs for a Zapier app, console logs and HTTP logs. The console logs are created by your app through the use of the <code>z.console.log</code> method (<a href="#console-logging">see below for details</a>). The HTTP logs are created automatically by Zapier whenever your app makes HTTP requests (as long as you use <code>z.request([url], options)</code> or shorthand request objects).</p><p>To view the logs for your application, use the <code>zapier logs</code> command. There are three types of logs, <code>http</code> (logged automatically by Zapier on HTTP requests), <code>bundle</code> (logged automatically on every method execution), and <code>console</code> (manual logs via <code>z.console.log()</code> statements).</p><p>For advanced logging options including only displaying the logs for a certain user or app version, look at the help for the logs command:</p>
<p>To view the logs for your application, use the <code>zapier logs</code> command.</p><p>There are three types of logs for a Zapier app:</p><ul>
<li><code>http</code>: logged automatically by Zapier on HTTP requests</li>
<li><code>bundle</code>: logged automatically on every method execution</li>
<li><code>console</code>: manual logs via <code>z.console.log()</code> statements (<a href="#console-logging">see below for details</a>)</li>
</ul><p>For advanced logging options, including only displaying the logs for a certain user or app version, look at the help for the logs command:</p>
</div>
<div class="col-md-7 col-sm-12 col-height docs-code">
<pre><code class="lang-bash">zapier <span class="hljs-built_in">help</span> logs
Expand Down Expand Up @@ -4208,7 +4212,7 @@ <h3 id="console-logging">Console Logging</h3>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>The <code>z.console</code> object has all the same methods and works just like the Node.js <a href="https://nodejs.org/docs/latest-v6.x/api/console.html"><code>Console</code></a> class - the only difference is we&apos;ll log to our distributed datastore and you can view them via <code>zapier logs</code> (more below).</p>
<p>The <code>z.console</code> object has all the same methods and works just like the Node.js <a href="https://nodejs.org/docs/latest-v14.x/api/console.html"><code>Console</code></a> class - the only difference is we&apos;ll log to our distributed datastore and you can view the logs via <code>zapier logs</code> (more below).</p>
</div>
<div class="col-md-7 col-sm-12 col-height is-empty docs-code">

Expand Down Expand Up @@ -4264,7 +4268,7 @@ <h3 id="http-logging">HTTP Logging</h3>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>If you are using the <code>z.request()</code> shortcut that we provide - HTTP logging is handled automatically for you. For example:</p>
<p>If you are using <a href="#shorthand-http-requests">shorthand HTTP requests</a> or the <code>z.request()</code> method that we provide, HTTP logging is handled automatically for you. For example:</p>
</div>
<div class="col-md-7 col-sm-12 col-height docs-code">
<pre><code class="lang-js">z.request(<span class="hljs-string">&apos;https://57b20fb546b57d1100a3c405.mockapi.io/api/recipes&apos;</span>)
Expand All @@ -4276,6 +4280,15 @@ <h3 id="http-logging">HTTP Logging</h3>
</div>
</div>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>HTTP logging will often work with other methods of making requests as well, but if you&apos;re using another method and having trouble seeing logs, try using <code>z.request()</code>.</p>
</div>
<div class="col-md-7 col-sm-12 col-height is-empty docs-code">

</div>
</div>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<h3 id="viewing-http-logs">Viewing HTTP Logs</h3>
Expand All @@ -4297,7 +4310,7 @@ <h3 id="viewing-http-logs">Viewing HTTP Logs</h3>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>To see detailed http logs including headers, request and response bodies, etc, do:</p>
<p>To see detailed HTTP logs, including data such as headers and request and response bodies, do:</p>
</div>
<div class="col-md-7 col-sm-12 col-height docs-code">
<pre><code class="lang-bash">zapier logs --<span class="hljs-built_in">type</span>=http --detailed
Expand Down

0 comments on commit c50f0f2

Please sign in to comment.