Information
The Defaults logfile entry sets the path to the sudo log file. Setting a path turns on logging to a file; negating this option turns it off. By default, sudo logs via syslog.
More information about the sudoers configuration files, their location, and load preference is available in the section overview.
Defining a dedicated log file for sudo simplifies auditing of sudo commands and creation of auditd rules for sudo.
Solution
Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f <PATH TO FILE> and add the following line:
Defaults logfile="<PATH TO CUSTOM LOG FILE>"
Example:
Defaults logfile="/var/log/sudo.log"
Impact:
WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files.
Creation of additional log files can cause disk space exhaustion if not correctly managed. You should configure logrotate to manage the sudo log in accordance with your local policy.