Since you said midnight… I would do the following:
Use webadmin to find your relay object(s) and go to the logging panel. Is logging enabled ?
If so, is it going to a database ?
If so, what is the rotation set to.
If Database, then find the ReportingDB object which is the DB connection to the reporting database.
Bring up the properties with webadmin.
What type of database is it set to ?
If HSQL, then go to your stoneware Loader server (server that talks to your directory).
Go to the file system /stoneware/hsql.
What is the size of the logging.data file ?
My guess is that your logging is on and set to hsql. HSQL can become corrupt if servers are not shut down properly or you use the windows service to shut down webNetwork. When you do not use the 8090 console to shut down webNetwork and just do something like net stop webNetwork, windows may not give it enough time to shut down properly before it kills the process. This along with power outages where the server just shuts off can cause the HSQL database to corrupt. The HSQL works fine for stuff like the community calendars and such, but logging is large amounts of data and HSQL is a file based db. If you require the webserver logging of logins, and every request that a user makes, it is suggested that the logging db be moved to a real SQL server like MySQL or MSSQL.
Another option is to shut down the loader, delete the /stoneware/hsql/logging.* files and then copy /stoneware/hsql/orig/logging.* /stoneware/hsql
This will copy a fresh clean uncorrupt copy of the logging database.
The other option is to disable logging on each relay object and restart the relay.
Also, the relationship to midnight… it is when the relay sends the SQL command to purge old log entries. If the DB is corrupt then it may cause the relay / loader to hang.