log (OSPFv2)

Controls the generation of OSPFv2 logs.
Syntax
log { adjacency [ dr-only ] | all | bad_packet [ checksum ] | database | memory | retransmit }
no log { adjacency [ dr-only ] | all | bad_packet [ checksum ] | database | memory | retransmit }
Command Default

Only OSPFv2 messages indicating possible system errors are logged. Refer to the Parameters section for specific defaults.

Parameters
adjacency
Specifies the logging of essential OSPFv2 neighbor state changes. This option is disabled by default.
dr-only
Specifies the logging of essential OSPF neighbor state changes where the interface state is designated router (DR).
all
Specifies the logging of all syslog messages.
bad-packet
Specifies the logging of bad OSPFv2 packets. This option is enabled by default.
checksum
Specifies all OSPFv2 packets that have checksum errors.
database
Specifies the logging of OSPFv2 LSA-related information. This option is disabled by default.
memory
Specifies the logging of OSPFv2 memory issues. This option is enabled by default.
retransmit
Specifies the logging of OSPFv2 retransmission activities. This option is disabled by default.
Modes

OSPF router configuration mode

OSPF router VRF configuration mode

Usage Guidelines

Use this command to disable or re-enable the logging of specific events related to OSPFv2. If this command is not enabled only OSPFv2 messages indicating possible system errors are logged.

For interfaces where the designated router state is not applicable, such as point-to-point and virtual links, OSPF neighbor state changes are always logged irrespective of the setting of the dr-only sub-option.

A limitation with the dr-only sub-option is that when a DR/BDR election is underway, OSPF neighbor state changes pertaining to non-DR/BDR routers are not logged. Logging resumes once a DR is elected on that network.

The no form of the command restores the default settings. Use the no log all command to return all OSPFv2 logging options to the default settings.

Examples

The following example enables the logging of all OSPFv2-related syslog events.

device# configure terminal
device(config)# router ospf
device(config-ospf-router)# log all

The following example enables the logging of OSPFv2 retransmission activities.

device# configure terminal
device(config)# router ospf
device(config-ospf-router)# log retransmit