< Home

Configuring the Device to Output Debugging Messages to the Log File

Context

A log file can save debugging messages, logs and traps. After you configure the debugging message output function, the system saves debugging messages in log files so that you can check device operating information from the log files later.

The device can output debugging messages to a user log file (log.log) or a diagnostic log file (log.dblg), which are both saved in the logfile folder. When the log file size exceeds the specified value, the system compresses the file into a zip package and names the compressed file date time.log.zip or date time.dblg.zip, for example, 2013-08-14.04-55-23.log.zip or 2013-09-05.05-15-23.dblg.zip.

By default, the system does not output debugging messages to a log file.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run info-center logfile channel { channel-number | channel-name }

    The channel used by the device to output debugging messages to a log file is specified.

    By default, the device uses channel 9 to output debugging messages into a log file.

  3. Run info-center source { module-name | default } channel { channel-number | channel-name } debug { state { off | on } | level severity } *

    A rule for outputting debugging messages to a channel is set.

    By default, channel 9 is disabled to output debugging messages and the lowest severity is debugging.

  4. (Optional) Run info-center logfile size size

    The log file size is set.

    By default, the log file size is 8 MB.

    If the size of a log file generated on the device exceeds the configured log file size, the system decompresses the log file into a zip file.

  5. (Optional) Run info-center max-logfile-number filenumbers

    The maximum number of log files that can be saved is set.

    By default, a maximum of 200 log files can be saved.

    If the number of log files generated on the device exceeds the limit, the system deletes the oldest log file.

    If the remaining flash memory space is less than 30 MB, earlier compressed log files are deleted. If no compressed log files can be deleted and the remaining flash memory space is less than 30 MB, no log files will be generated.

  6. Run the quit command to return to the user view.
  7. (Optional) Run save logfile or save logfile all

    Logs in the log buffer are saved to a log file. To view current log information, run this command to save the logs in the log buffer to a log file.

    Logs in the log buffer can be manually saved to a log file. These logs will also be saved in a log file in the following situations:
    • Since the device starts, logs in the log buffer will be automatically saved to a log file every 24 hours, and this saving interval cannot be configured.
    • When the 64 KB log buffer is full, logs in the log buffer will be automatically saved to a log file, and the log buffer size cannot be configured.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >