Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

logging logrotate

 

Syntax

Description

This command allows you to manage the system.log files.

Options

Parameter

Description

Range

Default Value

maxage days

Sets the number of days that a log file is kept.

At the end of this period, the log file is deleted.

1 to 31

30

remote-url protocol:url

Specifies the remote server to which to move the log file when the file is rotated out of local storage.

When a log file is rotated out, it is transferred to the specified server, and then deleted from local storage. The log file is deleted regardless of whether the transfer is successful or not.

scp|sftp|ftp://
[username@]host
[:port]/[filepath]

username is the username to use on the remote server.

host is the host name or IP address of the remote server.

port is the protocol port number to use.

filepath is the directory where you want to place the log file. This is the path only and does not include the file name, which is auto-generated.

sftp://None

This default means that remote-url is not used.

If username is not specified, the current CLI session’s login name is used.

If port is not specified, the standard default SCP, FTP, or SFTP port is used.

If filepath is not specified, the file is copied to the SCP/FTP/SFTP user’s home directory.

password password

The password associated with the specified username

If a password is not specified, the system prompts you for a password.

Note: The password must contain alphanumeric characters only.

A character string

None

rotate number

Sets the number of files to include in the data collection.

Once this number is reached, the next log rotation causes the oldest log file to be deleted or transferred out (if remote-url is configured).

This number corresponds to the number of rotations that can occur before the currently active log file is removed or transferred out.

1 to 3

3

size size

Sets the size of the log files (MB).

When this limit is reached on the currently active log file, log rotation is performed.

1 to 50

15

Required Privilege Level

Related Documentation

  • None

Sample Output

bti7800(config)# logging logrotate remote-url sftp://user@mycompany.com/logs maxage 10 size 30