The info-center timestamp command sets the timestamp format of logs, traps, and debugging messages.
The undo info-center timestamp command restores the default timestamp format of logs, traps, and debugging messages.
By default, the date timestamp is used in traps, logs and debugging messages. Debugging messages are accurate to milliseconds, and traps and logs are accurate to seconds.
info-center timestamp { debugging | log | trap } { { date | format-date | short-date } [ precision-time { second | tenth-second | millisecond } ] | boot } [ without-timezone ]
undo info-center timestamp { debugging | trap | log }
Parameter | Description | Value |
---|---|---|
debugging | Indicates debugging messages. | - |
log | Indicates logs. | - |
trap | Indicates traps. | - |
boot | Indicates that the timestamp is expressed in the format of relative time, a period of time since the start of the system. The format is xxxxxx.yyyyyy. xxxxxx is the higher order 32 bits of the milliseconds elapsed since the start of the system; yyyyyy is the lower order 32 bits of the milliseconds elapsed since the start of the system. | - |
date | Specifies the current date and time. It is expressed in mm dd yyyy hh:mm:ss format. | - |
short-date | Indicates the short date. This timestamp differs from date is that the year is not displayed. | - |
format-date | Indicates that the timestamp is expressed in YYYY-MM-DD hh:mm:ss format. | - |
precision-time | Specifies the precision. | - |
second | Indicates that the precision is accurate to seconds. | - |
tenth-second | Indicates that the precision is accurate to 0.1 second. | - |
millisecond | Indicates that the precision is accurate to milliseconds. | - |
without-timezone | Specifies a timestamp to filter timezone information. NOTE:
If without-timezone is configured for logs, traps, or debug information, the log, trap, or debugging information sent to the log host does not carry time zone or DST information. |
- |
The info-center timestamp command sets the timestamp format of logs, traps, and debugging messages.
The following describes the timestamp in date format.
Field |
Description |
Value |
---|---|---|
mm |
Month |
The value can be Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, or Dec. |
dd |
Date |
1-31. If the date is smaller than 10, add a space in front of the date, For example, " 7". |
yyyy |
Year |
4 digits |
hh:mm:ss |
Local time |
hh ranges from 00 to 23, and mm or ss ranges from 00 to 59. |
When the precision of the timestamp is accurate to 0.1 second or milliseconds, the system adds identifiers to the logs generated at the same time based on the sequence.
Prerequisites
The information center has been enabled by using the info-center enable command.
# Set the timestamp format of traps to boot.
<HUAWEI> system-view [HUAWEI] info-center timestamp trap boot
# Set the timestamp precision of logs, traps, and debugging messages.
<HUAWEI> system-view [HUAWEI] info-center timestamp log date precision-time millisecond [HUAWEI] info-center timestamp debugging date precision-time tenth-second [HUAWEI] info-center timestamp trap date precision-time millisecond