Embedded Syslog Manager Configuration Guide, Cisco IOS XE Release 3S
Logging to Local Nonvolatile Storage (ATA Disk)
Downloads: This chapterpdf (PDF - 149.0KB) | Feedback

Logging to Local Nonvolatile Storage

Table Of Contents

Logging to Local Nonvolatile Storage

Finding Feature Information

Contents

Prerequisites for Logging to Local Nonvolatile Storage

Restrictions for Logging to Local Nonvolatile Storage

Information About Logging to Local Nonvolatile Storage

System Logging Messages

How to Configure Logging to Local Nonvolatile Storage

Writing Logging Messages to Bootflash or a Harddisk

Copying Logging Messages to an External Disk

Configuration Examples for Logging to Local Nonvolatile Storage

Writing Logging Messages to bootflash or a Harddisk: Example

Copying Logging Messages to an External Disk: Example

Additional References

Related Documents

Standards

MIBs

RFCs

Technical Assistance

Feature Information for Logging to Local Nonvolatile Storage


Logging to Local Nonvolatile Storage


First Published: August 26, 2003
Last Updated: February 28, 2009

The Logging to Local Nonvolatile Storage feature enables system logging messages to be saved on an advanced technology attachment flash disk. Messages saved on bootflash or a harddisk persist after a router is rebooted.

Finding Feature Information

For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the "Feature Information for Logging to Local Nonvolatile Storage" section.

Use Cisco Feature Navigator to find information about platform support and Cisco IOS XE software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.

Contents

Prerequisites for Logging to Local Nonvolatile Storage

Restrictions for Logging to Local Nonvolatile Storage

Information About Logging to Local Nonvolatile Storage

How to Configure Logging to Local Nonvolatile Storage

Configuration Examples for Logging to Local Nonvolatile Storage

Additional References

Feature Information for Logging to Local Nonvolatile Storage

Prerequisites for Logging to Local Nonvolatile Storage

The logging buffered Command Must Be Enabled

Before the Logging to Local Nonvolatile Storage feature can be enabled with the logging persistent command, you must enable the logging of messages to an internal buffer with the logging buffered command. For additional information, refer to the "Writing Logging Messages to Bootflash or a Harddisk" section, and to the "Related Documents" section.

Restrictions for Logging to Local Nonvolatile Storage

Available bootflash or harddisk Space Constrains the Size and Number of Stored Log Files

The amount of bootflash or harddisk space allocated to system logging messages constrains the number of logging files that can be stored. When the allocation threshold is passed, the oldest log file in the directory is deleted to make room for new system logging messages. To permanently store system logging messages, you must archive them to an external device. For more information, refer to the "Copying Logging Messages to an External Disk" section.


Note Logging to Local Nonvolatile Storage can use up to 2 GB of storage space.


Information About Logging to Local Nonvolatile Storage

The Logging to Local Nonvolatile Storage feature adds a router's bootflash or harddisk as a storage destination for logging messages. When using this feature, be sure to understand the following concepts:

System Logging Messages

How to Configure Logging to Local Nonvolatile Storage

System Logging Messages

System logging messages include error and debug messages generated by application programming interfaces (APIs) on the router. Typically, logging messages are stored in a router's memory buffer; when the buffer is full, older messages are overwritten by new messages. All logging messages are erased from the memory buffer when the router reboots.

How to Configure Logging to Local Nonvolatile Storage

This section contains the following procedures:

Writing Logging Messages to Bootflash or a Harddisk (required)

Copying Logging Messages to an External Disk (optional)

Writing Logging Messages to Bootflash or a Harddisk

Perform this task to enable the Logging to Local Nonvolatile Storage feature and write logging messages to bootflash or a harddisk:

SUMMARY STEPS

1. enable

2. configure terminal

3. logging buffered [buffer-size | severity-level]

4. logging persistent [url {harddisk:/directory | harddisk:/directory}] [size filesystem-size]
[filesize logging-file-size]

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

configure terminal

Example:

Router# configure terminal

Enables global configuration mode.

Step 3 

logging buffered [buffer-size | severity-level]

Example:

Router(config)# logging buffered

Enables system message logging to a local buffer and limits messages logged to the buffer based on severity.

The optional buffer-size argument specifies the size of the buffer from 4096 to 4294967295 bytes. The default size varies by platform.

The optional severity-level argument limits the logging of messages to the buffer to those no less severe than the specified level.

Step 4 

logging persistent [url {harddisk:/directory}] [size filesystem-size] [filesize logging-file-size]

Example:

Router(config)# logging persistent url harddisk:/syslog size 134217728 filesize 16384


Note The default value is:
url: bootflash:/syslog
filesystem-size: 10% of total disk space
logging-file-size: 262144

Writes logging messages from the memory buffer to the specified directory on the router's bootflash or a harddisk.

Before logging messages are written to a file on the bootflash or a harddisk, the Cisco IOS XE software checks to see if there is sufficient disk space. If not, the oldest file of logging messages (by timestamp) is deleted, and the current file is saved.

The filename format of log files is log_MM:DD:YYYY::hh:mm:ss. For example: log_11:26:2008::01:01:41.

Note This feature supports only one log file per second due to its filename format, which contains timestamp suffix down to the seconds level.

Copying Logging Messages to an External Disk

Perform this task to copy logging messages from the bootflash or a harddisk to an external disk.

SUMMARY STEPS

1. enable

2. copy source-url destination-url

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

copy source-url destination-url

Example:

Router# copy harddisk:/syslog ftp://myuser/mypass@192.168.1.129/syslog

Copies the specified file or directory on the bootflash or a harddisk via FTP to the specified URL.

Configuration Examples for Logging to Local Nonvolatile Storage

This section provides the following configuration examples:

Writing Logging Messages to bootflash or a Harddisk: Example

Copying Logging Messages to an External Disk: Example

Writing Logging Messages to bootflash or a Harddisk: Example

The following example shows how to write up to 134217728 bytes (128 MB) of logging messages to the syslog directory of disk 0, specifying a file size of 16384 bytes:

Router(config)# logging buffered
Router(config)# logging persistent url harddisk:/syslog size 134217728 filesize 16384

Copying Logging Messages to an External Disk: Example

The following example shows how to copy logging messages from the router's bootflash or harddisk to an external disk:

Router# copy harddisk:/syslog ftp://myuser/mypass@192.168.1.129/syslog

Additional References

The following sections provide references related to the Logging to Local Nonvolatile Storage feature.

Related Documents

Related Topic
Document Title

copy command

Cisco IOS Configuration Fundamentals Command Reference

Network Management commands (including logging commands): complete command syntax, defaults, command mode, command history, usage guidelines, and examples

Cisco IOS Network Management Command Reference


Standards

Standards
Title

No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.


MIBs

MIBs
MIBs Link

No new or modified MIBs are supported by this feature, and support for existing MIBs has not been modified by this feature.

To locate and download MIBs for selected platforms, Cisco IOS XE releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs


RFCs

RFCs
Title

No new or modified RFCs are supported by this feature, and support for existing RFCs has not been modified by this feature.


Technical Assistance

Description
Link

The Cisco Support website provides extensive online resources, including documentation and tools for troubleshooting and resolving technical issues with Cisco products and technologies.

To receive security and technical information about your products, you can subscribe to various services, such as the Product Alert Tool (accessed from Field Notices), the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS) Feeds.

Access to most tools on the Cisco Support website requires a Cisco.com user ID and password.

http://www.cisco.com/techsupport


Feature Information for Logging to Local Nonvolatile Storage

Table 1 lists the release history for this feature.

Not all commands may be available in your Cisco IOS XE software release. For release information about a specific command, see the command reference documentation.

Use Cisco Feature Navigator to find information about platform support and software image support. Cisco Feature Navigator enables you to determine which Cisco IOS XE software images support a specific software release, feature set, or platform. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.


Note Table 1 lists only the Cisco IOS XE software release that introduced support for a given feature in a given Cisco IOS XE software release train. Unless noted otherwise, subsequent releases of that Cisco IOS XE software release train also support that feature.


Table 1 Feature Information for Logging to Local Nonvolatile Storage

Feature Name
Releases
Feature Information

Logging to Local Nonvolatile Storage

Cisco IOS XE Release 2.1

The Logging to Local Nonvolatile Storage feature enables system logging messages to be saved on an advanced technology attachment flash disk. Messages saved on bootflash or a harddisk persist after a router is rebooted.

The following command was introduced or modified: logging persistent.