14. Unsatisfactory ace logs
The log Part of ACE is a very beautiful implementation, which can be effectively and securely used in multi-thread and multi-process models. However, there are a few shortcomings, which are not enough.
14.1 time stamp format that cannot be replaced
The ACE log format is fixed for the timestamp and adopts the format. This format is quite satisfactory for Westerners, but not satisfactory for orients. The better way is, of course, the timestamp function can be reloaded. You can also use a function object (pointer) as a parameter.
Although this part of the code can be reloaded to solve this problem, it is not worthwhile to modify this problem.
14.2 The log policy initialization method is awkward
ACE provides a log policy class named ace_logging_strategy to help you define a log policy. However, its initialization parameter is a command line parameter, not a variable parameter.
Int
Ace_logging_strategy: Init (INT argc, ace_tchar * argv [])
You must use this command line to initialize the log policy module.
-M1024-N10-fstderr | ostream-S ../log/c4ad. Log
Developers with several servers will put the initialization of these log policies on the command line parameters.
14.3 there is no way to split log files by day (time)
The log file segmentation policy of ACE_Logging_Strategy splits files by file size and the serial number of the files is scroll. However, this log segmentation method cannot be used to understand the log Content Based on the file time, (because the file serial number is to be rolled, the last modification time of the serial number file is the same), you can only search for all the logs in grep for the content you want.
In my opinion, it is better to separate log files by date. Create a new log file every day to facilitate log segmentation. The workload for cleaning and management is greatly reduced.
14.4 log slot Method
ACE_Logging_Strategy uses the log slot to Enable or Disable some levels of logs. However, the log level of ACE itself is classified. I personally think it would be a better choice if the log output level is greater than the defined level.
The best way to solve the ACE_Logging_Strategy problem is to extend this class. Implement your own log policy class.