我要评分
获取效率
正确性
完整性
易理解

Log Control

Focus:

  • Check whether the system can limit the size of a single log file.
  • Check whether there is a mechanism for clearing logs after the log space is used up.

Checking HAF Logs

The log function of HAF is configured in configuration files. Logs are classified into audit logs and run logs. The configuration file for audit logs is LogAuditCfg.json, and the configuration file for run logs is LogServiceCfg.json.

You can modify following configurations in the /home/omm/haf-install/haf-target/run/haf_user and /home/omm/haf-install/haf-target/run/daemon directories.

  • Check whether the system can limit the size of a single log file. logSize specifies the size of a log file. The value ranges from 1 MB to 100 MB.
  • Check whether the system can limit the number of log files or the total size of log files. backupCount specifies the number of backup logs. The value ranges from 0 to 100.
  • Check whether there is a mechanism for clearing logs after the log space is used up. Overwrite backup logs.

The log configuration is as follows:

{
    "autoReload": false,
    "backupCount": 10,
    "logFile": "service.log",
    "logHeaderFormat": "%time%user%level%pid%tname%function%line",
    "logLevel": "INFO",
    "logPath": "/home/omm/haf-install/haf-target/logs/haf_user",
    "logSize": 10485760
}