fjpanag commented on a change in pull request #3842:
URL: https://github.com/apache/incubator-nuttx/pull/3842#discussion_r645425612



##########
File path: drivers/syslog/syslog_filechannel.c
##########
@@ -108,6 +168,12 @@ FAR struct syslog_channel_s *syslog_file_channel(FAR const 
char *devpath)
       syslog_dev_uninitialize(g_syslog_file_channel);
     }
 
+  /* Rotate the log file, if needed. */
+
+#ifdef CONFIG_SYSLOG_FILE_ROTATE
+  log_rotate(devpath);

Review comment:
       Theoretically you are right. This can happen.  
   However, in practice this is very rare, and I prefer to keep the simple 
solution.
   
   What you describe is a good idea, but I am afraid that it won't work 
easily/correctly.  
   There is no easy way to manipulate the log after it is opened without 
side-effects:
   * Either the system will block during the rotation, possibly harming high 
priority threads.
   * Or there will be lost logs.
   
   Unfortunately, it is not possible to predict when the rotation will take 
place. This will have an impact on the real-time behavior of the system. 
Keeping the rotations during opening only keeps the system predictable.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to