Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[SUPPORTENG-520] docs(cli): Update logging info #591

Merged
merged 3 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ <h3 id="oauth2">OAuth2</h3>
</div><div class="row">
<div class="row-height">
<div class="col-md-5 col-sm-12 col-height docs-primary">
<p>For OAuth2, <code>authentication.oauth2Config.authorizeUrl</code>, <code>authentication.oauth2Config.getAccessToken</code>, and <code>authentication.oauth2Config.refreshAccessToken</code> have fields like <code>redirect_uri</code> and <code>state</code> in <code>bundle.inputData</code>. After the code is exchanged for an access token and/or refresh token, those tokens are stored in <code>bundle.authData</code> for the connection.</p><p>Also, <code>authentication.oauth2Config.getAccessToken</code> has access to the additional return values in <code>rawRequest</code> and <code>cleanedRequest</code> should you need to extract other values (for example, from the query string).</p>
<p>For OAuth2, <code>authentication.oauth2Config.authorizeUrl</code>, <code>authentication.oauth2Config.getAccessToken</code>, and <code>authentication.oauth2Config.refreshAccessToken</code> have fields like <code>redirect_uri</code> and <code>state</code> in <code>bundle.inputData</code>. After the code is exchanged for an access token and/or refresh token, those tokens are stored in <code>bundle.authData</code> for the connection.</p><p>Also, <code>authentication.oauth2Config.getAccessToken</code> has access to the additional return values in <code>rawRequest</code> and <code>cleanedRequest</code> should you need to extract other values (for example, from the query string).</p><p>If you define <code>fields</code> to collect additional details from the user, please note that <code>client_id</code> and <code>client_secret</code> are reserved keys and cannot be used as keys for input form fields.</p>
</div>
<div class="col-md-7 col-sm-12 col-height is-empty docs-code">

Expand Down 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 @@ -1398,11 +1398,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 @@ -1416,7 +1420,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 @@ -1436,7 +1440,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 @@ -1446,14 +1450,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 @@ -2551,11 +2551,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 @@ -2569,7 +2573,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 @@ -2589,7 +2593,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 @@ -2599,14 +2603,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