To enable the logs, simply set the HSM_LOG_LEVEL environment variable to one of the values below:
1 - INFO
2 - WARNING
3 - ERROR
4 - DEBUG
Setting the environment variable via the terminal
export HSM_LOG_LEVEL=1
Setting the environment variable via javascript
process.env.HSM_LOG_LEVEL = "4"; // DEBUG
To direct the logs to a file, simply set the HSM_LOG_DIR environment variable to the path of the folder where the
file will be created.
If this variable is not set, the logs will be directed to the console.
Setting the environment variable via the terminal
export HSM_LOG_DIR=/var/logs/hsm_logs
Setting the environment variable via javascript
process.env.HSM_LOG_DIR = "/var/logs/hsm_logs";
The Session Pool manages a pool of HSM TCP/TLS sessions for concurrent operations. Use connectPooled() to obtain handles that automatically share the pool. The pool is configured via environment variables:
| Variable | Default | Description |
|---|---|---|
HSM_SESSION_POOL_MIN |
3 |
Minimum number of sessions kept active. Sessions above this minimum are recycled after becoming idle. |
HSM_SESSION_POOL_MAX |
10 |
Maximum number of simultaneous sessions. Checkouts exceeding this limit are placed in a queue. |
| Variable | Default | Description |
|---|---|---|
HSM_SESSION_POOL_QUEUE_MAX |
100 |
Maximum queue depth. Checkouts that exceed this limit are immediately rejected with a SessionPoolQueueFullError. |
HSM_SESSION_POOL_QUEUE_TIMEOUT_MS |
30000 |
The maximum time (in milliseconds) that a checkout can wait in the queue before being rejected with a SessionPoolQueueTimeoutError. |
| Variable | Default | Description |
|---|---|---|
HSM_SESSION_POOL_IDLE_TIMEOUT_MS |
60000 |
The time (in milliseconds) that an idle session above the minimum threshold remains active before being recycled. |
HSM_SESSION_POOL_AUTOSCALING_MAX |
= MAX |
Autoscaler limit. Sets the maximum number of sessions when PoolAutoscaler is enabled. |
| Variable | Default | Description |
|---|---|---|
HSM_SESSION_POOL_CONTROL_PATH |
OS-dependent | Caminho do Unix socket (ou named pipe no Windows) para patches de configuração em tempo de execução. Padrão: <tmpdir>/dinamo-hsm-pool.sock (Linux) ou \\.\pipe\dinamo-hsm-pool (Windows). |
export HSM_SESSION_POOL_MIN=5
export HSM_SESSION_POOL_MAX=20
export HSM_SESSION_POOL_QUEUE_MAX=200
export HSM_SESSION_POOL_QUEUE_TIMEOUT_MS=60000
export HSM_SESSION_POOL_IDLE_TIMEOUT_MS=120000
process.env.HSM_SESSION_POOL_MIN = "5";
process.env.HSM_SESSION_POOL_MAX = "20";
process.env.HSM_SESSION_POOL_QUEUE_MAX = "200";
process.env.HSM_SESSION_POOL_QUEUE_TIMEOUT_MS = "60000";
process.env.HSM_SESSION_POOL_IDLE_TIMEOUT_MS = "120000";
PIX (PIXPost, PIXPut, PIXGet, PIXDelete) network operations delegate the mTLS handshake and HTTP communication to a pool of native processes (dinamonh). The pool is configured via environment variables:
| Variable | Default | Description |
|---|---|---|
HSM_NATIVE_HOST_POOL_MIN |
3 |
Minimum number of connections kept active. Connections above this minimum are recycled after they become idle. |
HSM_NATIVE_HOST_POOL_MAX |
10 |
Maximum number of simultaneous connections. Tasks exceeding this limit are placed in a queue. |
| Variable | Default | Description |
|---|---|---|
HSM_NATIVE_HOST_QUEUE_MAX |
100 |
Maximum queue depth. Tasks beyond this limit are immediately rejected with a NativeHostQueueFullError. |
HSM_NATIVE_HOST_QUEUE_TIMEOUT_MS |
30000 |
The maximum time (in milliseconds) that a task can wait in the queue before being rejected with a NativeHostQueueTimeoutError. |
| Variable | Default | Description |
|---|---|---|
HSM_NATIVE_HOST_IDLE_TIMEOUT_MS |
60000 |
The time (in milliseconds) that an idle connection above the minimum threshold remains active before being recycled. |
HSM_NATIVE_HOST_WATCHDOG_MARGIN_MS |
2000 |
Grace period (ms) added to the task's timeoutMs before the watchdog terminates the connection. |
HSM_NATIVE_HOST_BACKOFF_BASE_MS |
1000 |
Base delay (ms) for exponential backoff after a connection crash. It doubles with each consecutive crash. |
HSM_NATIVE_HOST_BACKOFF_MAX_MS |
30000 |
Exponential backoff timeout (ms) for a connection with repeated crashes. |
| Variable | Default | Description |
|---|---|---|
HSM_NATIVE_HOST_PATH |
dinamonh |
Absolute or relative path to the dinamonh binary. If it is not in the PATH, specify the full path. |
export HSM_NATIVE_HOST_POOL_MIN=5
export HSM_NATIVE_HOST_POOL_MAX=20
export HSM_NATIVE_HOST_QUEUE_MAX=200
export HSM_NATIVE_HOST_QUEUE_TIMEOUT_MS=60000
export HSM_NATIVE_HOST_PATH=/opt/dinamo/bin/dinamonh
process.env.HSM_NATIVE_HOST_POOL_MIN = "5";
process.env.HSM_NATIVE_HOST_POOL_MAX = "20";
process.env.HSM_NATIVE_HOST_QUEUE_MAX = "200";
process.env.HSM_NATIVE_HOST_QUEUE_TIMEOUT_MS = "60000";
process.env.HSM_NATIVE_HOST_PATH = "/opt/dinamo/bin/dinamonh";