Skip to main content
Jamf Nation, hosted by Jamf, is the largest Apple IT management community in the world. Dialog with your fellow IT professionals, gain insight about Apple device deployments, share best practices and bounce ideas off each other. Join the conversation.

Enabling Debug Mode

Overview

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 will cover how to enable additional logging for: the Jamf Pro Server, Jamf Pro Applications, Self Service on macOS, Policies, Packages, and MDM. This article will also cover viewing logs on macOS and iOS.

Products Affected

Jamf Pro applications v9.96 or later

To enable Debug Mode and/or Statement Logging in Jamf Pro:

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

  • Check the "Enable Debug Mode" box and/or "Enable Statement Logging" checkbox

Alternatively, we can also edit the log4j.properties file on the server itself within/Path/To/Tomcat/webapps/ROOT/WEB-INF/classes/

  • To enable debug mode using this method, change "log4j.rootLogger=INFO,JAMF" to "log4j.rootLogger=DEBUG,JAMF" and then restart Apache Tomcat

  • To disable debug mode using this method, change "log4j.rootLogger=DEBUG,JAMF" to "log4j.rootLogger=INFO,JAMF" and then restart Apache Tomcat


To Enable Debug Mode for Jamf Applications:

  • Create a directory or file named "debug" within: /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

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


To enable Debug Mode for Self Service on macOS:

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

defaults write ~/Library/Preferences/com.jamfsoftware.selfservice debug_mode -boolean YES
  • The output for this log is in in the JAMFDebug.log in:~/Library/Logs/JAMF/

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


How to get more information using the jamf binary:

  • Run jamf binary commands with the -verbose flag. For example:
sudo jamf policy -event <eventName> -verbose

To get 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, run the following:
sudo defaults write /Library/Preferences/com.jamfsoftware.jamf.plist global_log_level DEBUG
  • To disable, run the following:
sudo defaults delete /Library/Preferences/com.jamfsoftware.jamf.plist global_log_level

To enable additional MDM logging on macOS clients:

  • Create and modify these 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

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


How to view logs on macOS

  • The Console app (/Applications/Utilities/) has a new user interface for macOS Sierra.

  • There is now an ability to view logs per trusted device - iOS, watchOS, or tvOS.


How to view logs from an iOS device:

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.

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.

Like Comment
Order by:
SOLVED Posted: by SeanA

Recommend retitling KB document to include statement logging (AKA "Enabling Debug Mode and Statement Logging")

Also, is there a way to enable statement logging via a file on the server (similar to enabling/disabling debug mode)?

Like
SOLVED Posted: by SeanA

According to our STAM, there is a way to enable to statement logging by modifying a file (feel free to confirm/test knowledge until such time this KB article is updated; our STAM had to courageously trek deep into the corridors of the mystical Dev kingdom to bring out this nugget):

Here is the workflow if needed: Open/Edit the log4j.properties File in: OS X: sudo nano /Library/JSS/Tomcat/webapps/ROOT/WEB-INF/classes/log4j.properties Windows: C:\Program Files\JSS\Tomcat\webapps\ROOT\WEB-INF\classes\log4j.properties Linux: /usr/local/JSS/Tomcat/webapps/ROOT/WEB-INF/classes/log4j.properties Add the following line: log4j.logger.org.hibernate.SQL=DEBUG Then Restart Tomcat. If you want to remove statement logging, delete that line and restart Tomcat once more. We do not recommend leaving the JSS in debug or statement logging modes long term, as this causes the logs to roll over much more frequently, and makes it tough to monitor the logs for general error messages due to the extra verbosity.
Like
SOLVED Posted: by captam3rica

Hi,

Not sure if this was intended but under the section for "Enabling Debug in Jamf Applications" should the command be mkdir instead of touch? The touch command would only create a file in the defined path. Versus mkdir actually creating the necessary directory.

Like
SOLVED Posted: by stephen.perry-GS

To @captam3rica 's point, would be helpful if Jamf would QA their documentation (as well as their product).

Like
SOLVED Posted: by lucas.nelson

Hi @captam3rica,

Thank you for asking for clarification on this workflow. Debug mode is pretty neat in the Jamf Apps as they will detect either a directory or a file named "debug" in the /Support directory and both will enable the debug logging.

This way, we can use mkdir and touch interchangeably and is completely up to you which you want to use. Let us know if you have any other questions we can answer on this.

Thank you,
Lucas Nelson

Like
SOLVED Posted: by stephen.perry-GS

@lucas.nelson That's great and everything, however, the KB specifically states "Create a directory named "debug" within: " while using the touch command in the example. If we could not leave things open to interpretation in the technical documentation and just provide the necessary information, that would be great.

Like
JAMFBadge
SOLVED Posted: by diana.breza

This article was updated with a note and example about using touch and mkdir interchangeably to enable debug mode for Jamf Applications.

Like