Enabling Debug Mode

This article will assist you in enabling Debug Mode for several Jamf products, as well as where to view logs from your Apple devices so that you can troubleshoot on a deeper level. This article also explains how to enable additional logging for: the Jamf Pro Server, Jamf Pro Applications, Self Service on macOS, Policies, Packages, and MDM. Instructions for viewing iOS logs on macOS are also provided.

Enabling Debug Mode or Statement Logging in Jamf Pro

There are three methods to enable debug mode or statement logging:

  • Method 1—Select checkboxes in the logging.html file.

  • Method 2—Edit the log4j2.xml file for Jamf Pro 10.31.0 or later.

  • Method 3—Edit the log4j.properties file for Jamf Pro 10.30.0 or earlier.

Method 1—Selecting Checkboxes in the logging.html File

  1. Go to the following URL for your Jamf Pro server:
    • For On-Premise Jamf Pro Servers: https://jamfpro.mycompany.com:8443/logging.html

    • For Hosted Jamf Pro Servers: https://jamfpro.mycompany.jamfcloud.com/logging.html

  2. Select the Enable Debug Mode or Enable Statement Logging checkbox.

Method 2—Edit the log4j2.xml File for Jamf Pro 10.31.0 or Later

Requirements

Jamf Pro 10.31.0 or Later

Edit the log4j2.xml file on the server within the following path: /Path/To/Tomcat/webapps/ROOT/WEB-INF/classes/
  • To enable debug mode, change <Root level="info" includeLocation="false"> to <Root level="debug" includeLocation="false">, and then restart Tomcat.

  • To disable debug mode, change <Root level="debug" includeLocation="false"> to <Root level="info" includeLocation="false">, and then restart Tomcat.

Method 3—Edit the log4j.properties File for Jamf Pro 10.30.0 or Earlier

Requirements

Jamf Pro 10.30.0 or Earlier

Edit the log4j.properties file on the server within the following path: /Path/To/Tomcat/webapps/ROOT/WEB-INF/classes/
  • To enable debug mode, change log4j.rootLogger=INFO,JAMF to log4j.rootLogger=DEBUG,JAMF, and then restart Tomcat.

  • To disable debug mode, change log4j.rootLogger=DEBUG,JAMF to log4j.rootLogger=INFO,JAMF, and then restart Tomcat.

Enabling Debug Mode for Jamf Applications

Debug logging only works for the Jamf Admin, Jamf Remote, and Jamf Imaging apps.

Create a directory or file named "debug" within the following path: /path/to/Jamf Application.app/Contents/Support

For example:
touch /Applications/Jamf\ Pro/Jamf\ Admin.app/Contents/Support/debug
mkdir /Applications/Jamf\ Pro/Jamf\ Admin.app/Contents/Support/debug
Note:

You can use touch and mkdir interchangeably.

The output for this log is in the Jamf__________Debug.log in:
~/Library/Logs/JAMF/
To disable the debug logging, remove the following directory or file:
/Applications/Jamf\ Pro/Jamf<ApplicationName>.app/Contents/Support/debug

Enabling Debug Mode for Self Service on macOS

Modify the existing Self Service PLIST to put it in debug mode by executing the following command:

defaults write ~/Library/Preferences/com.jamfsoftware.selfservice debug_mode -boolean YES

The output for this log is in the JAMFDebug.log in ~/Library/Logs/JAMF/.

To disable debug logging, remove the PLIST file in ~/Library/Preferences/com.jamfsoftware.selfservice

Getting More Information Using the jamf binary

Run jamf binary commands with the -verbose flag. 

For example:

sudo jamf policy -event <eventName> -verbose

Getting Additional Logging Information on Packages and Policies

Additional logging with package download and install is available on enrolled computers beginning with v9.92 of Jamf Pro. By default, additional logging is disabled for all users. Additional logging during a package install goes to the client computer's jamf.log file with a special marker "[DEBUG]" indicating it is extra information. The policy log uploaded to Jamf Pro does not change when additional logging is enabled.

Individual computers can have additional logging enabled or disabled by writing a specific key to a preferences file on that computer. Debug logging can be enabled or disabled on computers using a script deployed as a policy.

To enable, execute the following command:
sudo defaults write /Library/Preferences/com.jamfsoftware.jamf.plist global_log_level DEBUG
To disable, execute the following command:
sudo defaults delete /Library/Preferences/com.jamfsoftware.jamf.plist global_log_level

Enabling Additional MDM Logging on macOS Clients

Create and modify the following files:
sudo defaults write /Library/Preferences/com.apple.MCXDebug debugOutput -2
sudo defaults write /Library/Preferences/com.apple.MCXDebug collateLogs 1
sudo touch /var/db/MDM_EnableDebug
Note:

Computers must be restarted to enable the debugging.

The output for this log is in the following locations:
/Library/Logs/ManagedClient/ManagedClient.log
and
/var/log/system.log
To disable debug logging, remove the following files and reboot the machine:
/var/db/MDM_EnableDebug
and
/Library/Preferences/com.apple.MCXDebug.plist

Viewing iOS Logs on macOS

Apple Configurator 2 has the ability to view logs of attached iOS devices.

  1. Connect an iOS device to a Mac that is running Apple Configurator 2.
  2. When the iOS device is connected, double-click its icon in the "All Devices" page of Apple Configurator 2.
  3. In the device window, click Console in the lefthand sidebar.
  4. To gather logs, click Clear and then reproduce your issue. Do not navigate away from the Console page while gathering logs.
  5. When you are finished gathering logs, click Save. The log file will be saved to your computer.
    Note:

    Be sure to turn off all debugging when you have completed your testing. Leaving applications or Jamf Pro in debug mode can cause excessive disk space to be taken up by log files.