Log
Log control configurations are detailed below.
| Variable | Quick Description |
|---|---|
HSM_LOG_LEVEL |
Level of information recorded in the log (1000: no log, 0: error, 3: debug). |
HSM_LOG_DIR |
Log directory path. |
HSM_LOG_FLUSH |
Log buffering control. |
Level
Environment variable to be set: HSM_LOG_LEVEL
| Value | Log Level |
|---|---|
| 1000 | Disabled: no event is logged. |
| 0 | Errors only: only records error situations (they usually prevent the requested service from running). |
| 3 | Debugging: records detailed operating information, as well as error, warning and information messages. |
The value specifies the desired type and detail level of events in the log file. Under normal operating conditions, it is recommended to keep library logging to a minimum. More detailed event logging can be used to diagnose operational issues.
Directory
Environment variable to be set: HSM_LOG_DIR
| Value | Log directory path |
|---|---|
| Not defined | It does not generate logs. |
| dir path | Full path of the log directory. |
stdout |
Directs log messages to the standard output stdout and error messages to stderr. Use the literal stdout. Generally used in container-based environments. |
The library attempts to create log files at the specified path; if it fails (due to lack of space, insufficient permissions, etc.), it will continue to execute operations normally.
When this environment variable is set, logs are generated by default with the debugging log level and with direct writing to the file (no caching). To change the logging level, set the environment variable HSM_LOG_LEVEL.
Log Flush
Environment variable to be set: HSM_LOG_FLUSH
Enables log messages to be written directly to the log file, without using a buffer.
| Value | Buffeting status |
|---|---|
| Not defined (or 0) | Log messages are buffered and written to the log file at intervals. |
| 1 | Log messages are immediately written to the file. |
The library can keep a small buffer of log messages before making the physical recording in the file, which allows for performance gains. In error conditions or diagnostic situations, it is interesting that the log is written immediately after the occurrence.
Naming convention for generated log files
Log files are generated per process that loads the library(ies), using the Process ID (PID) to differentiate the generated log files. The log file naming convention follows the rule below:
tacnd<library>_<PID>.log
Onde <library> pode ser:
- lib (biblioteca nativa)
- csp (biblioteca de integração MS CAPI/CNG)
- p11 (biblioteca de integração PKCS#11)
- jca (biblioteca de integração Java)
Example:
tacndlib_34565.log
tacndlib_42892.log
tacndcsp_24329.log
tacndcsp_17643.log