Skip to content

Commit d5742d4

Browse files
refactor variable name
Signed-off-by: kasey-alusi-vcc <[email protected]>
1 parent d6faa84 commit d5742d4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Unless you need to set a non-default value, it is recommended to only populate o
119119
| `HEDERA_NETWORK` | "" | Which network to connect to. Automatically populates the main node & mirror node endpoints. Can be `previewnet`, `testnet`, `mainnet` or a map of network IPs -> node accountIds e.g. `{"127.0.0.1:50211":"0.0.3"}` |
120120
| `INPUT_SIZE_LIMIT` | "1mb" | The [koa-jsonrpc](https://github.com/Bitclimb/koa-jsonrpc) maximum size allowed for requests |
121121
| `LOG_LEVEL` | "trace" | The logging level for the application. Valid values are `trace`, `debug`, `info`, `warn`, `error`, and `fatal`. |
122-
| `LOG_FORMAT` | "pretty" | The logging output format. Valid values are `pretty` (human-readable with colors) and `json` (structured JSON format for log aggregation systems). |
122+
| `PRETTY_LOGS_ENABLED` | "true" | Controls the logging output format. When set to `true` (default), uses human-readable pretty format with colors. When set to `false`, uses structured JSON format for log aggregation systems. |
123123
| `MAX_BLOCK_RANGE` | "5" | The maximum block number greater than the mirror node's latest block to query for |
124124
| `OPERATOR_ID_MAIN` | "" | Operator account ID used to pay for transactions. In `S.R.N` format, e.g. `0.0.1001`. |
125125
| `OPERATOR_KEY_FORMAT` | "DER" | Operator private key format. Valid types are `DER`, `HEX_ECDSA`, or `HEX_ED25519` |

packages/config-service/src/services/globalConfig.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,10 @@ const _CONFIG = {
362362
required: false,
363363
defaultValue: 'trace',
364364
},
365-
LOG_FORMAT: {
366-
type: 'string',
365+
PRETTY_LOGS_ENABLED: {
366+
type: 'boolean',
367367
required: false,
368-
defaultValue: 'pretty',
368+
defaultValue: true,
369369
},
370370
MAX_BLOCK_RANGE: {
371371
type: 'number',

packages/server/src/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { spec } from './koaJsonRpc/lib/RpcError';
1818
// https://nodejs.org/api/async_context.html#asynchronous-context-tracking
1919
const context = new AsyncLocalStorage<{ requestId: string }>();
2020

21-
const logFormat = ConfigService.get('LOG_FORMAT');
21+
const prettyLogsEnabled = ConfigService.get('PRETTY_LOGS_ENABLED');
2222

2323
const mainLogger = pino({
2424
name: 'hedera-json-rpc-relay',
@@ -28,8 +28,8 @@ const mainLogger = pino({
2828
const store = context.getStore();
2929
return store ? { requestId: `[Request ID: ${store.requestId}] ` } : {};
3030
},
31-
// Only use pino-pretty when LOG_FORMAT is set to 'pretty' (default)
32-
...(logFormat === 'pretty' && {
31+
// Use pino-pretty when PRETTY_LOGS_ENABLED is true (default), otherwise use JSON format
32+
...(prettyLogsEnabled && {
3333
transport: {
3434
target: 'pino-pretty',
3535
options: {

0 commit comments

Comments
 (0)