AXP 1.6 User Guide
Logging
Downloads: This chapterpdf (PDF - 174.0KB) The complete bookPDF (PDF - 3.06MB) | Feedback

Logging

Table Of Contents

Logging

Configuring the Syslog Server

Verifying the Syslog Server

Log File Management

Configuring Log File Size Limits

Viewing Log and Core Files

Clearing Log and Core Files

Copying Files

Syslog Server Logs

Configuring System Log Levels

Configuring Remote Logging

Summary of Common Logging Commands


Logging


This chapter consists of the following sections:

Configuring the Syslog Server

Verifying the Syslog Server

Log File Management

Configuring System Log Levels

Configuring Remote Logging

Summary of Common Logging Commands

Configuring the Syslog Server

The Configuration of a syslog server allows the Cisco AXP service module to collect log messages from other physical and virtual devices on the network. The syslog server binds to an interface to accept log messages from any source on the network.

A user can enable or disable the syslog server on the Cisco AXP service module and can specify the maximum log file size limits that can occupy the local file system space.

Because the syslog server cannot be configured to filter logs based on facility or priority, all log messages must be filtered before they are sent to the syslog server.

Log files generated by the syslog server reside in the /var/remote_log directory and the log file is named remote_messages.log. Rotated log files are appended with a number such as remote_messages.log.1, with the higher numbers designating older files. The oldest log file is deleted during a file rotation.

SUMMARY STEPS

1. configure terminal

2. syslog-server

3. syslog-server limit file-rotation size [file-size num]

4. syslog-server limit file-size size [ file-rotation num ]

5. exit

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

configure terminal

Enters configuration mode.

Step 2 

syslog-server 

Enables or disables the syslog server.

The syslog server is disabled by default.

If the server is enabled, the Cisco AXP service module is used as a syslog server to receive all the log files from external devices.

An error message

ERROR - system does not have enough disk space

appears if:

The system has less than 80-G disk storage

or

Available disk space does not satisfy the current limits set by file size and the number of files

Resolve error by either unloading applications to free disk space or by changing limits.

If this error occurs, you cannot enable the syslog server.

Step 3 

syslog-server limit file-rotation size [file-size num]

Sets syslog server limits.

file-rotation-—Defines the number of log files to be rotated. The range is 1 to 40 and the default is 10.

file-size—Defines the maximum size (in MB) of each log file. The range is 1 to 1000 MB and the default is 20 MB.

Setting the file rotation configuration lower than the current settings causes extra log files to be deleted.

Example

If the current file rotation value is 5 and the new file rotation value is 2, log files 3 to 5 are deleted.

A message

WARNING - setting the new file-rotation value to 2 from the old value of 5 caused extra log files to be removed

notifies the user if they have specified a new file rotation value that is lower than the current file rotation value.

Error messages:

Error Message    System does not have 
enough disk space.

This error occurs if the available system disk space is not enough to satisfy the new configured limits.

The file rotation and file size error messages appear if you enter an invalid value for a configuration. For example, if you enter 80001 as the file-size or 99 as the file-rotation.

The invalid values are rejected and the original limit values remain effective.

Error Message    File-rotation is out of 
range (1-10).
Error Message    File-size is out of range 
(1-80000).

Step 4 

syslog-server limit file-size size [file-rotation num]

Sets syslog server limits.

file-rotation—Defines the number of log files to be rotated. The range is 1 to 40 and the default is 10.

file-size—Defines the maximum size (in MB) of each log file. The range is 1 to 1000 MB and the default is 20 MB.

Setting the file rotation configuration lower than the current settings causes extra log files to be deleted.

Example

If the current file rotation value is 5 and the new file rotation value is 2, log files 3 to 5 will be deleted.

A message

WARNING - setting the new file-rotation value to 2 from the old value of 5 caused extra log files to be removed

notifies the user if they have specified a new file rotation value that is lower than the current file rotation value.

Error messages:

Error Message    System does not have 
enough disk space.

This error arises if the available system disk space is not enough to satisfy the new configured limits.

The file rotation and file size error messages are displayed if an invalid value is entered for a configuration. For example, if you enter 80001 as the file-size or 99 as the file-rotation.

The invalid values are rejected and the original limit values remain effective.

Error Message    File-rotation is out of 
range (1-10).
Error Message    File-size is out of range 
(1-80000).

Step 5 

exit

Exits configuration mode.

Verifying the Syslog Server

To verify the Syslog server status, perform the following step.

SUMMARY STEPS

1. show syslog-server

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

show syslog-server

Verifies the server status. See the "Syslog Server Logs" section.

Log File Management

Configuring Log File Size Limits

To configure the log file size, perform the following steps.

SUMMARY STEPS

1. configure terminal

2. app-service application-name

3. limit log-file size megabytes

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

configure terminal

Enters global configuration mode.

Step 2 

app-service application-name

Enters application service mode.

Step 3 

limit log-file size megabytes

Sets the size of the log file /var/log/messages.log. Each virtual instance writes a syslog to its own file /var/log/messages.log.

Once this file reaches the limit specified by this command, its contents are moved to a backup log file messages.log.prev and a new messages.log file is started.

The range is 0 to 40 MB with a default size of 5 MB for two files.

When the log file size reaches its limit, messages are moved to an alternate file messages.log.prev.

megabytes—The range of the log file size from
0 to 40 MB.

When the value is out of range, the following message appears:

%Invalid input detected at `^' marker 

If the log file size limits are not set (no limit log-file size), the size reverts to the default value of 5 MB.

If the log file size is set to 0 MB, a minimum file size of 10 KB is set.

To view log files under the /var/log directory, use the show log name command.

Viewing Log and Core Files

SUMMARY STEPS

1. app-service application-name

2. show cores

3. show logs

4. show log name log-name {containing expression | paged | interactive | {|begin | |exclude | |include [string | module] | |page} | tail}

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

app-service application-name

Enters application service mode.

Step 2 

show cores

Lists core files that reside in the application service environment.

Step 3 

show logs

Displays all the log files under /var/log directory of the virtual instance.

Step 4 

show log name log-name {containing expression | paged | interactive | {|begin | |exclude | |include [string | module] | |page} | tail}


Displays the specified log. Keyword options are:

containing—Only displays events matching a regex pattern.

paged—Displays enough output to fill the current viewing screen.

begin—Display begins with the line that matches.

include—Display includes lines that match.

exclude—Display excludes lines that match.

page—Displays paginated output.

tail—Waits for events and prints them as they occur.

| — (Pipe) Output to another command. Displays the specified log. After "log-name", additional keywords may be added. For example, |page pipes output to another command and paginates the output.
For more information on the use of pipe with keywords, refer to the show log name command in the latest
Cisco AXP Command Reference Guide.

Clearing Log and Core Files

Log files can also be cleared in system EXEC mode.

SUMMARY STEPS

1. app-service application-name

2. clear cores

3. clear logs

4. clear core core-name

5. clear log log-name

6. exit

System EXEC mode

7. clear logs

8. clear log name log-name

9. exit

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

app-service application-name

Enters application service mode.

Step 2 

clear cores

Deletes the core files of the application from the disk.

Step 3 

clear logs

Clears the contents of all the log files of the application.

Step 4 

clear core name core-name

Clears the specified core file of the application.

Step 5 

clear log name log-name

Clears the content of the specified log file of the application.

Step 6 

exit

Exits application service mode.


In system EXEC mode:

Note System EXEC mode is similar to Privileged EXEC mode in Cisco IOS software.

Step 7 

clear logs

Clears contents of all host log files except the syslog server log files.

Step 8 

clear log name log-name

Clears contents of the specified host log file. This command does not clear a syslog server log file.

Step 9 

exit

Exits system EXEC mode.

Copying Files

Core names and log names can contain wildcards (*). You can copy log files in application service EXEC sub-mode or in system EXEC mode. Bundled log files that are copied must be appended with a .gz suffix to the tar file. File extensions must be either .tgz or .tar.gz.

SUMMARY STEPS

1. app-service application-name

2. copy core core-name url ftp/http url

3. copy log log-name url ftp/http url/texfile

4. copy logs bundle destfilename.tar.gz url url

5. exit

In system EXEC mode:

6. copy log log-name url ftp/http url/textfile

7. copy logs bundle destfilename.tar.gz url url

8. exit

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

app-service application-name

Enters application service mode.

Step 2 

copy core core-name url ftp/http url

Copies the specified core file to a remote URL.

ftp/http url: FTP or HTTP server address

The standard ftp URL format is supported:

ftp://[user-id:ftp-password@]ftp-server-address[/di
rectory]

Step 3 

copy log log-name url ftp/http url/textfile

Copies syslog, trace, and custom application log files for the specified application to a text file at a remote URL. Wildcards (*) may be used to copy more than one log file to the text file.

Step 4 

copy logs bundle destfilename.tar.gz url url 

Copies a tar file containing syslog files, and custom application log files from the guest operating system to a remote URL.

destfilename.tar.gz: Tar filename

url: Destination URL

Step 5 

exit

Exits application service mode.


In system EXEC mode:

System EXEC mode is similar to Privileged EXEC mode in Cisco IOS software.

Step 6 

copy log log-name url ftp/http url/textfile 
Example:
#copy log * url ftp://lab1@10.1.10.2/log.txt 

Copies Cisco AXP host operating system log files to a text file at a remote URL. Wildcards (*) may be used to copy more than one log file to the text file. The text file contains the contents of each log file with a separator between the contents of each log file.

Step 7 

copy logs bundle destfilename.tar.gz url url 
Example: 
SE-Module> copy logs bundle destfilename.tar 
url url

Copies a tar file containing syslog files and custom application log files on the host and guest operating sytems to a remote URL.

This command does not copy the remote syslog server log files.

destfilename.tar.gz: Tar filename

url: Destination URL

Step 8 

exit 

Exits system EXEC mode.

Syslog Server Logs

All commands are in system EXEC mode.

SUMMARY STEPS

1. show syslog-server logs

2. show syslog-server log name log-name {paged | |}

3. clear syslog-server logs

4. clear syslog-server log name log-name

5. copy syslog-server logs bundle destination-filename.gz url ftp/http url

6. copy syslog-server log name log-name url ftp/http url

7. exit

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

show syslog-server logs 

Lists all the syslog server log files.

Step 2 

show syslog-server log name log-name {paged | |}

Displays the specified syslog server log file.

Keyword options are:

containing—Only displays events matching a regex pattern.

paged—Displays enough output to fill the current viewing screen.

begin—Display begins with the line that matches.

include—Display includes lines that match.

exclude—Display excludes lines that match.

page—Displays paginated output.

| — (Pipe) Output to another command. Displays the specified log. After "log-name", additional keywords may be added.
For more information on the use of pipe with keywords, refer to the show syslog-server log name command in the latest Cisco AXP Command Reference Guide.

Step 3 

clear syslog-server logs 

Clears the contents of all the syslog server log files.

Step 4 

clear syslog-server log name log-name 

Clears contents of the specified syslog server log file.

Step 5 

copy syslog-server logs bundle 
destination-filename.gz url ftp/http url 

Bundles all the syslog server log files into a gzip file and copy it to a remote URL.

destination-filename.gz—gzip filename

ftp/http url—Destination URL

Step 6 

copy syslog-server log name log-name url 
ftp/http url 

Copies the specified syslog server log file. A wildcard (*) may be used to copy more than one log file at a time.

Step 7 

exit

Exits system EXEC mode.

Configuring System Log Levels

SUMMARY STEPS

1. configure terminal

2. app-service application-name

3. log level levels

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

configure terminal

Enters global configuration mode.

Step 2 

app-service application-name

Enters application service mode.

Step 3 

log level levels

Example:

SE-Module(config-app-service)> log level info

Configures the system log level.

Applicable levels are:

info—Events with LOG_INFO and higher severity are logged, including all messages described in notice.

warn (Default)—Events with LOG_WARNING and higher severity are logged, including all error messages described in err.

err—Events with LOG_ERR and higher severity are logged, including LOG_EMERG, LOG_ALERT, and LOG_CRIT.

notice —Events with LOG_NOTICE and higher severity are logged, including all messages described in warn.

debug—Events with LOG_DEBUG and higher severity are logged, including all messages described in info.

Configuring Remote Logging

To configure remote logging, perform the following steps.

SUMMARY STEPS

1. configure terminal

2. app-service application-name

3. log server address hostname

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

configure terminal

Enters global configuration mode.

Step 2 

app-service application-name

Enters application service mode.

Step 3 

log server address hostname

Enables remote logging and configures the remote logging server.

Application syslog messages are sent to the specified log server.

The hostname can be an IP address or hostname.

When you enter an invalid IP address such as 0.0.0.0, the following error message appears:

Error Message    0.0.0.0 is an invalid Host IP 
address

Summary of Common Logging Commands

Table 11 Common Logging Commands 

Configuration Mode
Command
Purpose
SE-Module>

log console monitor

Configures error logging by means of console logging (logged messages are displayed on the console).

SE-Module>

log console

Configures the types of messages to be displayed on the console.

SE-Module(config)>

log server

Configures error logging by means of a system-log (syslog) server (syslog is an industry-standard protocol for capturing log information for devices on a network).

SE-Module>
or
SE-Module(exec-app-se
rvice)>

show log name

Displays a specific log file in the application environment.

SE-Module(confg-app-s
ervice)>

log server address

Configures the remote logging server.


Table 12 lists logging module definitions that are used to configure logging options.

Table 12 Logging Module Definitions 

AXP_install

AXP_upgrade

AXP_startup

AXP_rsrcmgr

AXP_cliapi

AXP_ssh

AXP_snmp

AXP_syslogsvr

AXP_cli

AXP_cliplugin

AXP_appdebug

AXP_guestos

AXP_vserial

AXP_iosapi

AXP_eventapi

AXP_svcapi



Note Among the keyword options for many log commands is a provision to display diagnostic output on your screen or to pipe it to a file or a URL.