cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4746
Views
15
Helpful
6
Replies

Logging to flash on Cisco 2960x

Andy White
Level 3
Level 3

Hello,

 

I normally log to flash, so if the switch loses power I don't lose the logs, on version 12.x I normally use:

 

logging persistent url flash:syslogs filesize 32768 size 131072

 

But on  this 15.x switch I can't get it to work, I've tried the above and made a new direcotry called LOGS, but it doesn't fill up:

 

logging file flash:/syslog 32768 31744 debugging

 

For the rest I add

 

Logging on

logging trap informational

logging console informational

logging monitor informational

Logging buffered 40960 debugging

 

Any ideas?

 

6 Replies 6

Jon Marshall
Hall of Fame
Hall of Fame

Not done this before but a couple of things -

1) as far as I understand it you need a file not a directory name

2) if you want to use a file in the syslog directory then you need to specify it eg.

logging file flash:/syslog/<filename> 32768 31744 debugging

assuming you have a directory called syslog in flash.

Jon

Thanks, I've added this:

 

logging file flash:/LOGS/logs 32768 31744 debugging

 

Will it just keep generate logs based on the max an min, seems to be a single file called logs there at the moment will stuff in it.

Yes, it will keep writing to that file with any new logging messages.

I'm not sure what it does when it reaches the max ie. does it start overwriting or does it just stop logging any new messages.

Do you know what happened on your other switches if the log file filled up ?

Jon

They create new ones when they hit the max size and do a sort of round robin so the flash never fills up. 

Hopefully the flash won't will run out of space, what will happen?

They create new ones but what happens to the existing ones ie. if new ones are being created eventually I would have thought space would run out..

If the space runs out it simply won't be able to create new file as far as I know.

Jon

tommar
Level 1
Level 1

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/esm/configuration/xe-16-6/esm-xe-16-6-book/log-local-nonvol.html

- Before logging messages are written to a file on the bootflash or harddisk, the Cisco 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.

Review Cisco Networking for a $25 gift card