You can turn off production logging, but it can make you very unprofitable when the end user reports an error and you donβt know what happened.
You should treat your logs as important data and protect their access to them at the operating system level, for example, access to database files. If an attacker accesses the database, he will still compromise the system. In the best case, the system administrator should have access to the log files and should provide them to developers only if necessary (a critical error during production, etc.).
source share