Debug Bitcoin Core Mining
If you mean the generate function, which creates blocks on demand, it is only available for the Regtest mode. Use the -regtest option to run in Regtest mode.

If you mean the setgenerate mining function, it has been disable since the 0.13 version of Bitcoin Core, due to the fact that mining difficulty became too high for doing it with CPUs.

If you want to restore that functionality you will need to restore the mining functionality code from a previous version and try to integrate it again in the source code (you will need to recompile it).

debug.log is the reference log file. You can refine the log output through the command line options. See https://en.bitcoin.it/wiki/Running_Bitcoin