I am trying to set a scheduled Apex job to run daily at 1AM. Records are not being inserted as I believe they should be. I imagine there is are errors occurring during execution of the class. I have a bunch of System.Debug statements to write errors that occur. I unfortunately do not see any debug logs listed on Setup -> Monitoring -> Debug Logs. All I see is User Trace Flags and an empty list under Debug Logs.
Debug logs are not running all the time, there is a limit of 20 logs captured per trace set up.
- Schedule the trace to start right before your batch scheduled time
- If the user is active in the system however this could consume the 20 logs before the batch is run
If your batch has a lot of 'chunks' you could consume the 20 logs before the error has occurred.
You best bet is to manually run the batch and monitor it via the dev console.