Configure logging settings on IOS-XR devices to control how system messages are handled, including destination configuration, severity levels, message formatting, source interface configuration, archive settings, file logging, suppress rules, and more.
Name Type Constraint Mandatory Default Value logging Class [logging]No
Name Type Constraint Mandatory Default Value archive Class [archive]No buffered Class [buffered]No console Choice alerts, critical, debugging, disable, emergencies, errors, informational, notifications, warningNo console_facility Choice allNo container_all Boolean true, falseNo container_fetch_timestamp Boolean true, falseNo events Class [events]No facility_level Choice all, audit, auth, authpriv, console, daemon, kern, local0, local1, local2, local3, local4, local5, local6, local7, mail, ntp, syslog, userNo files List [files]No format Choice bsd, rfc5424No history Choice alerts, critical, debugging, disable, emergencies, errors, informational, notifications, warningsNo hosts List [hosts]No history_size Integer min: 1, max: 500 No hostnameprefix String No ipv4_dscp Any Integer[min: 0, max: 63] or Choice[af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, cs1, cs2, cs3, cs4, cs5, cs6, cs7, default, ef] or String[Regex: ^.*[\$\%]\{.*$] No ipv4_precedence Any Integer[min: 0, max: 7] or Choice[critical, flash, flash-override, immediate, internet, network, priority, routine] or String[Regex: ^.*[\$\%]\{.*$] No ipv6_dscp Any Integer[min: 0, max: 63] or Choice[af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, cs1, cs2, cs3, cs4, cs5, cs6, cs7, default, ef] or String[Regex: ^.*[\$\%]\{.*$] No ipv6_precedence Any Integer[min: 0, max: 7] or Choice[critical, flash, flash-override, immediate, internet, network, priority, routine] or String[Regex: ^.*[\$\%]\{.*$] No localfilesize Integer min: 0, max: 4294967295 No monitor Class [monitor]No source_interfaces List [source_interfaces]No suppress_duplicates Boolean true, falseNo suppress_rules List [suppress_rules]No trap Choice alerts, critical, debugging, disable, emergencies, errors, informational, notifications, warningNo yang Choice alerts, critical, debugging, emergencies, errors, informational, notifications, warningsNo
Name Type Constraint Mandatory Default Value device Choice disk0, disk1, harddiskYes filesize Integer min: 1, max: 2047 No frequency Choice daily, weeklyNo length Integer min: 1, max: 256 No severity Choice alerts, critical, debugging, emergencies, errors, informational, notifications, warningsNo size Integer min: 1, max: 2047 No threshold Integer min: 1, max: 99 No
Name Type Constraint Mandatory Default Value discriminator_match1 String No discriminator_match2 String No discriminator_match3 String No discriminator_nomatch1 String No discriminator_nomatch2 String No discriminator_nomatch3 String No entries_count Integer min: 2545, max: 151699 No level Choice alerts, critical, debugging, emergencies, errors, informational, notifications, warningsNo size Integer min: 307200, max: 125000000 No
Name Type Constraint Mandatory Default Value buffer_size Integer min: 1024, max: 1024000 No display_location Boolean true, falseNo filter_matches List [filter_matches]No level Choice alerts, critical, emergencies, errors, informational, notifications, warningsNo precfg_suppression Choice enableNo precfg_suppression_timeout Integer min: 1, max: 60 No threshold Integer min: 10, max: 100 No
Name Type Constraint Mandatory Default Value name String Yes accounting_remote_facility Choice auth, cron, daemon, kern, local0, local1, local2, local3, local4, local5, local6, local7, lpr, mail, news, sys10, sys11, sys12, sys13, sys14, sys9, syslog, user, uucpNo discriminator_match1 String No discriminator_match2 String No discriminator_match3 String No discriminator_nomatch1 String No discriminator_nomatch2 String No discriminator_nomatch3 String No maxfilesize Integer min: 1, max: 2097152 No path String No severity Choice alerts, critical, debugging, emergencies, error, info, notifications, warningNo
Name Type Constraint Mandatory Default Value address String Yes vrf String Yes severity Choice alerts, critical, debugging, emergencies, error, info, notifications, warningNo port Integer min: 0, max: 65535 No operator Choice equals, equals-or-higher, not-equalsNo facility Choice all, audit, auth, authpriv, console, daemon, kern, local0, local1, local2, local3, local4, local5, local6, local7, mail, ntp, syslog, userNo source_address String No
Name Type Constraint Mandatory Default Value discriminator_match1 String No discriminator_match2 String No discriminator_match3 String No discriminator_nomatch1 String No discriminator_nomatch2 String No discriminator_nomatch3 String No level Choice alerts, critical, debugging, disable, emergencies, errors, informational, notifications, warningNo
Name Type Constraint Mandatory Default Value name String Yes vrf String Yes
Name Type Constraint Mandatory Default Value name String Yes alarms List [alarms]No all_alarms Boolean true, falseNo apply_to Class [apply_to]No
Name Type Constraint Mandatory Default Value match String Yes
Name Type Constraint Mandatory Default Value category String Yes code String Yes group String Yes
Name Type Constraint Mandatory Default Value all_of_router Boolean true, falseNo source_locations List [source_locations]No
Name Type Constraint Mandatory Default Value name String Yes
DSCP and Precedence Values
Logging DSCP and precedence fields accept both numeric and named string values.
ipv4_dscp / ipv6_dscp: integer 0-63 or named value (e.g., ef, af11, cs3)
ipv4_precedence / ipv6_precedence: integer 0-7 or named value (e.g., flash, critical, network)
Both formats can be used interchangeably. The normalization layer automatically converts integer values to their named equivalents before sending to the device, preventing configuration drift.
Syslog Hosts
The hosts list accepts IPv4 addresses, IPv6 addresses, and hostnames in the address field. The Terraform module automatically detects the address type and routes entries to the appropriate attributes (IPv4, IPv6, or hostname). Each host entry requires a vrf field to specify the VRF context (default for the global table).
Example-1: Configure basic logging with console, monitor, buffered, and trap settings.
Example-2: Configure logging with archive settings.
Example-3: Configure logging with filter matches and events configuration.
precfg_suppression : enable
precfg_suppression_timeout : 30
Example-4: Logging with QoS marking, source interfaces, and global settings.
suppress_duplicates : true
Example-5: Configure logging with VRF-scoped syslog hosts (IPv4, IPv6, and hostname).
source_address : 192.168.1.1
operator : equals-or-higher
source_address : 2001:db8::1