major
minor
major
minor
minor
#27019
Inconsistent logging: scheduler uses its own log file, but its tasks do not
The scheduler has its own log file. However, tasks do not use this file, even though they are located in exactly the same part of the code. Therefore, both should log to the same files.
The cause is a pattern in the log configuration that is too specific. Only the class `tl:Scheduler` is redirected to the specific file. Instead, the entire package should be redirected.
Implementation
The pattern was changed to the package `com.top_logic.util.sched `. As a result, this package and its “internal” packages now use the scheduler log.
However, the individual `tl:Task` and `tl:Batch` implementations were not redirected there. The effort required to do so is too high: Log4j does not offer a way to filter classes by their superclasses. This would have to be implemented manually.
Additionally, the behavior where warnings and errors from the scheduler are written only to its own log has not been changed. They are therefore still not written to the main application log. Here, too, the effort would be too great due to Log4j’s limitations, as this would have to be implemented manually.
Code Migration
Custom log configurations must also be adjusted if the scheduler writes to its own log file there as well:
- In all log configurations, search for: <Logger name="com.top_logic.util.sched.Scheduler"
- Replace it everywhere with: <Logger name="com.top_logic.util.sched"
Test
- Before starting the demo, delete the old log files from there. (com.top_logic.demo/tmp/app-data/logs)
- Execute tasks in the demo.
- The file top-logic.main.log must not contain any entries from the com.top_logic.util.sched package.
- The file top-logic.scheduler.log must contain entries from com.top_logic.util.sched.task.log.TaskLogCommon and com.top_logic.util.sched.Scheduler.