Locked Logs

In one of our customers there is an issue caused by the locked Sage 300 log files. As we understood, these log files are created and deleted automatically during log in and log out from Sage 300. For some unknown for us a reason these files are locked on the client environment and they are not deleted during log out. As a result of this a subsequent log in to that Sage 300 company fails. The Sage 300 version is 2021.
Can someone give us a hint what could be the cause of the locking and how to prevent it?