**COPYING LOG TO FLASH** **I. Requirements** 1. Copy logs with a severity higher than debugging in the flash ,then set size of each log file to 128Kbytes. 2. Set size of log buffer to 128Kbytes. 3. Record action when user logs in and operates. 4. Add system name , sequence number and time stamps to each log entry. **II. Network Topology** {{:ruijie:switch:image006.png?400|}} **III. Configuration Tips** System doesn't copy logs from buffer to flash once finishing configuration, and it costs about half an hour to copy logs from buffer to flash , or the log buffer exceeds. **IV. Configuration Steps** Ruijie>enable Ruijie#configure terminal Ruijie(config)#logging file flash:syslog 6 ------>set log file name to "syslog" and system copies all logs with severity from 0 to 6 to flash Ruijie(config)#logging file flash:syslog 131072 ------>set size of each log file in flash to 128K Ruijie(config)#logging buffered 131072 ------>set log buffer size to 128K Ruijie(config)#logging userinfo ------>record actions when user logs in Ruijie(config)#logging userinfo command-log ------>record actions when user operates commands Ruijie(config)#service sysname ------>add system name to each log entry Ruijie(config)#service sequence-numbers ------>add sequence number to each log entry Ruijie(config)#service timestamps ------>add time stamps to each log entry **Ruijie#wr** **Note:We suggest you to set log buffer size to 128K because the buffer size is too small by defaut.** If the 1st log file is full , system copies logs to 2nd log file , then the 3th log file ……there're 16 log files at most in the same time , and if all 16 log files are full ,the new log entry overwrites the old one , so Log file never takes up the whole flash room. Enter **"more flash:xxx"** privilege EXEC command to display log entries and **"delete flash:xxx"** privilege EXEC command to delete log file in flash. **v. Verification** 1. This example shows how to display logs in buffer {{:ruijie:switch:image007.jpg?400|}} 2. Enter "dir" privilege EXEC command to check log files in flash {{:ruijie:switch:image008.jpg?400|}} 3. This example shows how to display logs in flash {{:ruijie:switch:image009.jpg?400|}} 4. Enter "clear logging" privilege EXEC command to clear logs in buffer {{:ruijie:switch:image010.jpg?400|}}