Skip to content

Commit

Permalink
Default to debug level for most examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhghomon committed Oct 24, 2024
1 parent 10a4980 commit 9224f1a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/content/doc-surrealdb/cli/start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ An instance with a single root user, able to connect to the internet but unable
surreal start --user root --pass root --allow-net --deny-funcs "crypto::md5, http::post, http::delete"
```

An instance with extra verbose logging that uses RocksDB as its storage engine:
An instance with more verbose logging that uses RocksDB as its storage engine:

```bash
surreal start --log trace rocksdb:mydatabase.db
surreal start --log debug rocksdb:mydatabase.db
```

An instance with all capabilities denied except a few functions and a single endpoint:
Expand Down
4 changes: 2 additions & 2 deletions src/content/doc-surrealdb/installation/running/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ mkdir mydata # Create a directory to store the database, owned by the current us
docker run --rm --pull always -p 8000:8000 --user $(id -u) -v $(pwd)/mydata:/mydata surrealdb/surrealdb:latest start rocksdb:/mydata/mydatabase.db
```

The default logging level for the database server is `info`, resulting in any informational logs to be output to the standard output. To control the logging verbosity, specify the *`--log`* argument. The following command starts the database with `trace` level logging, resulting in most logs being output to the terminal. If extra verbosity is not needed, specify a lower level or simply remove the flag, which will default to the `info` level.
The default logging level for the database server is `info`, resulting in any informational logs to be output to the standard output. To control the logging verbosity, specify the *`--log`* argument. The following command starts the database with `debug` level logging, resulting in more logs being output to the terminal. If extra verbosity is not needed, specify a lower level or simply remove the flag, which will default to the `info` level.

```bash
mkdir mydata # Create a directory to store the database, owned by the current user
docker run --rm --pull always -p 8000:8000 --user $(id -u) -v $(pwd)/mydata:/mydata surrealdb/surrealdb:latest start --log trace rocksdb:/mydata/mydatabase.db
docker run --rm --pull always -p 8000:8000 --user $(id -u) -v $(pwd)/mydata:/mydata surrealdb/surrealdb:latest start --log debug rocksdb:/mydata/mydatabase.db
```

### Configuring authentication
Expand Down
4 changes: 2 additions & 2 deletions src/content/doc-surrealdb/installation/running/file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ For the purposes of getting started with SurrealDB quickly, we will start a Rock
surreal start rocksdb:mydatabase.db
```

The default logging level for the database server is `info`, resulting in any informational logs to be output to the standard output. To control the logging verbosity, specify the *`--log`* argument. The following command starts the database with `trace` level logging, the maximum level of verbosity for output to the terminal. If extra verbosity is not needed, specify a lower level or simply remove the flag, which will default to the `info` level.
The default logging level for the database server is `info`, resulting in any informational logs to be output to the standard output. To control the logging verbosity, specify the *`--log`* argument. The following command starts the database with `debug` level logging, resulting in more logs being output to the terminal. If extra verbosity is not needed, specify a lower level or simply remove the flag, which will default to the `info` level.

```bash
surreal start --log trace rocksdb:mydatabase.db
surreal start --log debug rocksdb:mydatabase.db
```

In versions of SurrealDB before 2.0.0, anyone would be able to connect to this server to begin running queries. However, SurrealDB since version 2.0.0 runs with authentication by default. In order to disable it, the `--unauthenticated` flag can be passed in.
Expand Down
4 changes: 2 additions & 2 deletions src/content/doc-surrealdb/installation/running/memory.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ SurrealDB will assume `memory` in case this argument is not passed in, so the fo
surreal start
```

The default logging level for the database server is `info`, resulting in any informational logs to be output to the standard output. To control the logging verbosity, specify the *`--log`* argument. The following command starts the database with `trace` level logging, the maximum level of verbosity for output to the terminal. If extra verbosity is not needed, specify a lower level or simply remove the flag, which will default to the `info` level.
The default logging level for the database server is `info`, resulting in any informational logs to be output to the standard output. To control the logging verbosity, specify the *`--log`* argument. The following command starts the database with `debug` level logging, resulting in more logs being output to the terminal. If extra verbosity is not needed, specify a lower level or simply remove the flag, which will default to the `info` level.

```bash
surreal start --log trace memory
surreal start --log debug memory
```

In versions of SurrealDB before `2.0`, anyone would be able to connect to this server to begin running queries. However, SurrealDB since version `2.0` runs with authentication by default. In order to disable it, the `--unauthenticated` flag can be passed in.
Expand Down
4 changes: 2 additions & 2 deletions src/content/doc-surrealdb/installation/running/tikv.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Once TiKV is up and running, we can start a SurrealDB server instance, specifyin
```bash
surreal start tikv://127.0.0.1:2379
```
The default logging level for the database server is `info`, resulting in any informational logs to be output to the standard output. To control the logging verbosity, specify the *`--log`* argument. The following command starts the database with `trace` level logging, the maximum level of verbosity for output to the terminal. If extra verbosity is not needed, specify a lower level or simply remove the flag, which will default to the `info` level.
The default logging level for the database server is `info`, resulting in any informational logs to be output to the standard output. To control the logging verbosity, specify the *`--log`* argument. The following command starts the database with `debug` level logging, resulting in more logs being output to the terminal. If extra verbosity is not needed, specify a lower level or simply remove the flag, which will default to the `info` level.

```bash
surreal start --log trace tikv://127.0.0.1:2379
surreal start --log debug tikv://127.0.0.1:2379
```
In order to keep SurrealDB secure, configure your initial root-level user by setting the *`--user`* and *`--pass`* command-line arguments. The following command starts the database with a top-level user named root with a password also set to `root`. The root user will be persisted in storage, which means you don't have to include the command line arguments next time you start SurrealDB.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ For this guide, we will create a simple client-side web application that will di
We have developed an [example application](https://github.com/surrealdb/examples/tree/main/aws-cognito) that uses plain JavaScript to authenticate with Cognito using basic HTTP requests against the [login endpoint](https://docs.aws.amazon.com/cognito/latest/developerguide/login-endpoint.html) of the Cognito Hosted UI and the Cognito [token endpoint](https://docs.aws.amazon.com/cognito/latest/developerguide/token-endpoint.html). For the purposes of following this guide, we recommend using our example code. However, keep in mind that this code aims to be as simple as possible and is not suitable for production applications. Alternatively, you can develop this application yourself using the [Cognito SDK](https://docs.aws.amazon.com/cognito/latest/developerguide/service_code_examples_cognito-identity-provider.html) or the new [Amplify SDK](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-integrate-apps.html#cognito-integrate-apps-amplify).

When using our example code, you will only need to update the `config.json` file with the values that you saved after creating your user pool and run the web application using the `start.sh` script or any equivalent web server. Once in the web application, clicking the "Log in" button should take you to the Cognito Hosted UI to log in with your test user, after which you should be redirected back to your web application. For this to work, the URL of your web application (without a trailing slash) should be present in the "Allowed callback URLs" list that you defined when configuring the user pool client. After redirection, the web application will show some information about the authenticated user and attempt to create it in SurrealDB via the configured endpoint. After the user is created, subsequent logins will retrieve its information from SurrealDB and display it in the web application. If that is not the case, use the developer console of your browser together with the SurrealDB logs (running with `--log trace` during the debugging for extra verbosity) to understand why.
When using our example code, you will only need to update the `config.json` file with the values that you saved after creating your user pool and run the web application using the `start.sh` script or any equivalent web server. Once in the web application, clicking the "Log in" button should take you to the Cognito Hosted UI to log in with your test user, after which you should be redirected back to your web application. For this to work, the URL of your web application (without a trailing slash) should be present in the "Allowed callback URLs" list that you defined when configuring the user pool client. After redirection, the web application will show some information about the authenticated user and attempt to create it in SurrealDB via the configured endpoint. After the user is created, subsequent logins will retrieve its information from SurrealDB and display it in the web application. If that is not the case, use the developer console of your browser together with the SurrealDB logs (running with `--log trace` during the debugging for maximum verbosity) to understand why.

Once the example web application is working, you can inspect the simple code under `app.js` to understand how.

Expand Down

0 comments on commit 9224f1a

Please sign in to comment.