To stop the PDF printer from creating a log file, adjust its printer preferences:
1. Open Settings → Printers & scanners.
2. Find your PDF printer (e.g., Microsoft Print to PDF or Adobe PDF) and click Manage.
3. Click Printer preferences.
4. Locate the option labeled “font” (or a similar logging option) and untick it.
5. Apply the changes and close the dialog.
After disabling that option, printing to PDF will no longer generate a log file.