On this page
ios_logging - Manage logging on network devices
New in version 2.4.
Synopsis
- This module provides declarative management of logging on Cisco Ios devices.
 
Options
| parameter | required | default | choices | comments | 
|---|---|---|---|---|
| aggregate | 
      no | 
        
        List of logging definitions.
         | 
     ||
| dest | 
      no | 
       
  | 
      
        
        Destination of the logs.
         | 
     |
| facility | 
      no | 
        
        Set logging facility.
         | 
     ||
| level | 
      no | 
        
        Set logging severity levels.
         | 
     ||
| name | 
      no | 
        
        If value of  dest is file it indicates file-name, for user it indicates username and for host indicates the host name to be notified.
        | 
     ||
| size | 
      no | 4096 | 
        
        Size of buffer. The acceptable value is in range from 4096 to 4294967295 bytes.
         | 
     |
| state | 
      no | present | 
       
  | 
      
        
        State of the logging configuration.
         | 
     
Examples
- name: configure host logging
  ios_logging:
    dest: host
    name: 172.16.0.1
    state: present
- name: remove host logging configuration
  ios_logging:
    dest: host
    name: 172.16.0.1
    state: absent
- name: configure console logging level and facility
  ios_logging:
    dest: console
    facility: local7
    level: debugging
    state: present
- name: enable logging to all
  ios_logging:
    dest : on
- name: configure buffer size
  ios_logging:
    dest: buffered
    size: 5000
- name: Configure logging using aggregate
  ios_logging:
    aggregate:
      - { dest: console, level: notifications }
      - { dest: buffered, size: 9000 }
- name: remove logging using aggregate
  ios_logging:
    aggregate:
      - { dest: console, level: notifications }
      - { dest: buffered, size: 9000 }
    state: absent
  Return Values
Common return values are documented here Return Values, the following are the fields unique to this module:
| name | description | returned | type | sample | 
|---|---|---|---|---|
| commands | 
        
        The list of configuration mode commands to send to the device
         | 
      always | list | ['logging facility local7', 'logging host 172.16.0.1'] | 
Notes
Note
- Tested against IOS 15.6
 
Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Maintenance Info
For more information about Red Hat’s this support of this module, please refer to this knowledge base article<https://access.redhat.com/articles/rhel-top-support-policies>
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
 https://docs.ansible.com/ansible/2.4/ios_logging_module.html