Skip to content
Closed
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
2 changes: 1 addition & 1 deletion examples/cloudflare-workers-hono/scripts/client.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/cloudflare-workers/scripts/client.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@
// enabled: true,
// },
// vars: {
// RIVETKIT_LOG_LEVEL: "DEBUG",
// RIVETKIT_LOG_TARGET: "1",
// RIVETKIT_LOG_TIMESTAMP: "1",
// RIVETKIT_LOG_ERROR_STACK: "1",
// RIVETKIT_LOG_MESSAGE: "1",
// RIVET_LOG_LEVEL: "DEBUG",
// RIVET_LOG_TARGET: "1",
// RIVET_LOG_TIMESTAMP: "1",
// RIVET_LOG_ERROR_STACK: "1",
// RIVET_LOG_MESSAGE: "1",
// },
// };
// await fs.writeFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const RegistryConfigSchema = z
ctx.addIssue({
code: "custom",
message:
"advertiseEndpoint is required in production mode without endpoint",
"must specify either endpoint or advertiseEndpoint when in production mode",
path: ["advertiseEndpoint"],
});
}
Expand Down Expand Up @@ -212,7 +212,7 @@ export const RegistryConfigSchema = z
serveManager = config.serveManager ?? false;
invariant(
config.serverless.advertiseEndpoint,
"advertiseEndpoint is required in production mode without endpoint",
"advertiseEndpoint not specified in production mode",
);
advertiseEndpoint = config.serverless.advertiseEndpoint;
}
Expand Down
17 changes: 9 additions & 8 deletions rivetkit-typescript/packages/rivetkit/src/utils/env-vars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,24 @@ export const getRivetRunnerVersion = (): number | undefined => {

// RivetKit configuration
export const getRivetkitInspectorToken = (): string | undefined =>
getEnvUniversal("RIVETKIT_INSPECTOR_TOKEN");
getEnvUniversal("RIVET_INSPECTOR_TOKEN");
export const getRivetkitInspectorDisable = (): boolean =>
getEnvUniversal("RIVETKIT_INSPECTOR_DISABLE") === "1";
getEnvUniversal("RIVET_INSPECTOR_DISABLE") === "1";

// Logging configuration
// DEPRECATED: LOG_LEVEL will be removed in a future version
export const getLogLevel = (): string | undefined =>
getEnvUniversal("RIVETKIT_LOG_LEVEL");
getEnvUniversal("RIVET_LOG_LEVEL") ?? getEnvUniversal("LOG_LEVEL");
export const getLogTarget = (): boolean =>
getEnvUniversal("RIVETKIT_LOG_TARGET") === "1";
getEnvUniversal("RIVET_LOG_TARGET") === "1";
export const getLogTimestamp = (): boolean =>
getEnvUniversal("RIVETKIT_LOG_TIMESTAMP") === "1";
getEnvUniversal("RIVET_LOG_TIMESTAMP") === "1";
export const getLogMessage = (): boolean =>
getEnvUniversal("RIVETKIT_LOG_MESSAGE") === "1";
getEnvUniversal("RIVET_LOG_MESSAGE") === "1";
export const getLogErrorStack = (): boolean =>
getEnvUniversal("RIVETKIT_LOG_ERROR_STACK") === "1";
getEnvUniversal("RIVET_LOG_ERROR_STACK") === "1";
export const getLogHeaders = (): boolean =>
getEnvUniversal("RIVETKIT_LOG_HEADERS") === "1";
getEnvUniversal("RIVET_LOG_HEADERS") === "1";

// Environment configuration
export const getNodeEnv = (): string | undefined => getEnvUniversal("NODE_ENV");
Expand Down
10 changes: 5 additions & 5 deletions vitest.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export default {
},
env: {
// Enable logging
RIVETKIT_LOG_LEVEL: "DEBUG",
RIVETKIT_LOG_TARGET: "1",
RIVETKIT_LOG_TIMESTAMP: "1",
RIVETKIT_LOG_ERROR_STACK: "1",
RIVETKIT_LOG_MESSAGE: "1",
RIVET_LOG_LEVEL: "DEBUG",
RIVET_LOG_TARGET: "1",
RIVET_LOG_TIMESTAMP: "1",
RIVET_LOG_ERROR_STACK: "1",
RIVET_LOG_MESSAGE: "1",
},
},
} satisfies ViteUserConfig;
2 changes: 1 addition & 1 deletion website/src/content/docs/general/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ actor definitions include the following generic parameters that you'll see frequ
- rivet uses pino for logging
- we expose a scoped child logger for each actor at `c.log` that automatically logs the actor id + key
- this allows you to search lgos easily by actor id without having to log the actor id frequently
- logs can be configured via the `RIVETKIT_LOG_LEVEL` env var
- logs can be configured via the `RIVET_LOG_LEVEL` env var

### fault tolerance

Expand Down
14 changes: 7 additions & 7 deletions website/src/content/docs/general/logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ You can configure logging behavior using environment variables:

| Variable | Description | Values | Default |
| -------- | ----------- | ------ | ------- |
| `RIVETKIT_LOG_LEVEL` | Sets the minimum log level to display | `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `silent` | `warn` |
| `RIVETKIT_LOG_TARGET` | Include the module name that logged the message | `1` to enable, `0` to disable | `0` |
| `RIVETKIT_LOG_TIMESTAMP` | Include timestamp in log output | `1` to enable, `0` to disable | `0` |
| `RIVETKIT_LOG_MESSAGE` | Enable detailed message logging for debugging | `1` to enable, `0` to disable | `0` |
| `RIVETKIT_LOG_ERROR_STACK` | Include stack traces in error output | `1` to enable, `0` to disable | `0` |
| `RIVETKIT_LOG_HEADERS` | Log HTTP headers in requests | `1` to enable, `0` to disable | `0` |
| `RIVET_LOG_LEVEL` | Sets the minimum log level to display | `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `silent` | `warn` |
| `RIVET_LOG_TARGET` | Include the module name that logged the message | `1` to enable, `0` to disable | `0` |
| `RIVET_LOG_TIMESTAMP` | Include timestamp in log output | `1` to enable, `0` to disable | `0` |
| `RIVET_LOG_MESSAGE` | Enable detailed message logging for debugging | `1` to enable, `0` to disable | `0` |
| `RIVET_LOG_ERROR_STACK` | Include stack traces in error output | `1` to enable, `0` to disable | `0` |
| `RIVET_LOG_HEADERS` | Log HTTP headers in requests | `1` to enable, `0` to disable | `0` |

Example:
```bash
RIVETKIT_LOG_LEVEL=debug RIVETKIT_LOG_TARGET=1 RIVETKIT_LOG_TIMESTAMP=1 node server.js
RIVET_LOG_LEVEL=debug RIVET_LOG_TARGET=1 RIVET_LOG_TIMESTAMP=1 node server.js
```

### Log Level
Expand Down
Loading