03-17-2020 02:15 PM
I want to write syslogs to flash. But The only document I found online is:
Which doesn't say much about what options are available and what it does.
(config)#logging persistent ?
batch Set batch size for writing to persistent storage
filesize Set size of individual log files
immediate Write log entry to storage immediately (no buffering).
notify Notify when show logging [persistent] is activated.
protected Eliminates manipulation on logging-persistent files.
size Set disk space for writing log messages
threshold Set threshold for logging persistent
url URL to store logging messages
<cr>
Specifically, I am not sure what batch and threshold are used. Also, if I reload, the unwritten logs in buffer are gone. Is there a way to flush the logs manually?
03-17-2020 11:59 PM
Hello @pingduck ,
the document provides examples and explanations of almost all parameters.
The most important is threshold that establish the disk quota you can use for log files
When exceeding quota the oldest log file will be deleted to leave space to the newest log file.
The network device flash disk is not intended for this kind of use.
It would be better to have an external syslog server to a server that may be co-located if you have concerns about connectiivty to a branch site (i.e. you know this branch site connectivity is not stable).
If you have ever examined a show tech of a Cisco device you will see that messages are written to the local buffer and sent to external syslog before going down unless a power outage happens and there is no UPS protection.
Be also aware that the document refers to IOS, the current network devices run IOS XE or NX-OS or IOS XR.
Hope to help
Giuseppe
03-18-2020 08:56 AM
I have to disagree with you that the document is comprehensive. Parameters like "protected", "immediate", "notify", "alert", even "batch" aren't explained at all. That is more than 2/3 of the available parameters. Not to mention this is the only document I found. I can't even find the logging persistent command in CLI reference!
The "size" and "threshold" parameters are also not clear. Through other means I figured out threshold is a percentage. But what does the "threshold" applies to? Is it to the buffer in RAM? Or threshold of total size? Or threshold to batch size? The document says:
"When the allocation threshold is exceeded, the oldest log file in the directory is deleted to make room for new system logging messages"
I don't think that refers the threshold parameter. As it just have to remove 1 oldest log when the limit is reached.
I am using it on a Classic IOS router. But the same CLI is available on IOS-XE as well.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide