• Mac OS X,  Mac OS X Server,  Mac Security

    Logs, Logging, And Logger (Oh My)!

    Apple has a number of different logging APIs. For the past few releases, Apple has tried to capture everything possible in logs, creating what many administrators and developers might consider to be a lot of chatter. As such, an entirely new interface needed to be developed to categorize and filter messages sent into system logs. Writing Logs The logger command is still used to create entries in system logs. However, if you are then using tail to view /var/log/system.log then you will notice that you no longer see your entry being written. This is because as the logs being created in macOS have gotten more complex, the tools to read…

  • JAMF,  Windows Server

    Query Tomcat Logs On Windows Servers

    Tomcat logs events into the system log. You can use the get-wmiobject commandlet to see events. Here, we’ll look at a JSS and view only system events: Get-WmiObject Win32_NTLogEvent -ComputerName $jss -Filter "LogFile='system' We can then use AND to further constrain to specific messages, in this case those containing Tomcat: Get-WmiObject Win32_NTLogEvent -ComputerName $jss -Filter "LogFile='system' AND (Message like '%Tomcat%') We can then further constrain output to those with a specific EventCode with another compound statement: Get-WmiObject Win32_NTLogEvent -ComputerName $jss -Filter "LogFile='system' AND (Message like '%Tomcat%') AND (EventCode=1024) For a comprehensive list of Windows event codes, see https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/default.aspx. You could instead use get-eventlog to see system logs. For example, the…

  • Mac OS X,  Mac OS X Server

    log, logs, and logger

    This is the first page of a 5 page piece I just finished writing for MacTech. After the last episode of the MacAdmins podcast though, I wanted to go ahead and get some of the information out there. For a much more detailed analysis, check out MacTech! Apple has a number of different logging APIs. For the past few releases, Apple has tried to capture everything possible in logs, creating what many administrators and developers might consider to be a lot of chatter. As such, an entirely new interface needed to be developed to categorize and filter messages sent into system logs. Writing Logs The logger command is still used…

  • Mac OS X Server

    Check to See if Your Caching Server is Working

    One of the first things we do when we setup a new macOS Caching Server is to check the logs to see if it’s actually serving content. You can view thee logs at /Library/Server/Caching/Logs/Debug.log. In the log, when a Caching Server has registered for your network, you’ll see a line that begins with the following: Got request for host = http://swcdn.apple.com/ This above means that the server actually got a request (as it says) and that the request is for an asset at swcdn.apple.com (followed by the actual package path). Once found, the server caches the asset, which starts with the following: Initializing asset handler for http://swcdn.apple.com/ The path would…

  • Mac OS X Server,  Mac Security

    Accessing macOS Server 5.2 Logs

    macOS Sierra (10.12) running the Server app has a lot of scripts used for enabling services, setting states, changing hostnames and the like. Once upon a time there was a script for macOS Server 5.2 called serversetup. It was a beautiful but too simplistic kind of script. Today, much of that logic has been moved out into more granular scripts, kept in /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup, used by the server to perform all kinds of tasks. These scripts are, like a lot of other things in OS X Server. Some of these include the configuration of amavisd, docecot and alerts. These scripts can also be used for migrating services and data. Sometimes the scripts are in…

  • Apple Configurator,  iPhone

    Enable Apple Configurator Debug Logs

    Apple Configurator 2 is a great tool. But you need to debug things from time to time. This might mean that a profile is misconfigured and not installing, or that a device can’t perform a task you are sending it to be performed. This is about the time that you need to enable some debug logs. To do so, quit Apple Configurator and then write a string of ALL into the ACULogLevel key in ~/Library/Containers/com.apple.configurator.ui/Data/Library/Preferences/com.apple.configurator.ui.plist: defaults write ~/Library/Containers/com.apple.configurator.ui/Data/Library/Preferences/com.apple.configurator.ui.plist ACULogLevel -string ALL To disable, quit Apple Configurator and then delete that ACULogLevel key: defaults delete ~/Library/Containers/com.apple.configurator.ui/Data/Library/Preferences/com.apple.configurator.ui.plist ACULogLevel

  • Apple TV

    View Logs On Apple TV

    When applying management profiles, it helps to be able to look at the logs and troubleshoot why any settings aren’t applied. To view logs on an Apple TV, open Xcode and then click on an Apple TV. From the Apple TV screen, click on View Device Logs. The logs will appear in the app. Click Done when you’re finished reviewing the logs.

  • Apple Configurator,  iPhone

    Increase The Logging Level Of Apple Configurator

    Apple Configurator, by default, logs only a limited amount of data. To increase the logging level for Apple Configurator, use the defaults command to write All into the LogLevel key in com.apple.configurator, using the defaults command: defaults write com.apple.configurator LogLevel ALL Re-open Apple Configurator and you’re golden. Then, have some problems and be so happy to get some logs, viewable in Console. defaults read com.apple.configurator {AcceptedLicenseVersion = 20150317; CDFirstLaunch = 0; CDMainViewType = 3; ChaperoneCertificateIssuer = ; ChaperoneCertificateSerial = ; LogLevel = ALL; NSNavLastRootDirectory = "~/Desktop"; NSNavPanelExpandedSizeForSaveMode = "{712, 620}"; "NSToolbar Configuration C484E2C8-5B9C-4999-9304-7233D38B3F95" = { "TB Display Mode" = 1; "TB Icon Size Mode" = 1; "TB Is Shown" =…

  • Mac OS X Server,  Mac Security,  Mass Deployment

    OS X Server 5 Logs

    OS X running the Server app has a lot of scripts used for enabling services, setting states, changing hostnames and the like. Once upon a time there was a script for OS X Server called server setup. It was a beautiful but too simplistic kind of script. Today, much of that logic has been moved out into more granular scripts, kept in /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup, used by the server to perform all kinds of tasks. These scripts are, like a lot of other things in OS X Server. Some of these include the configuration of amavisd, docecot and alerts. These scripts can also be used for migrating services and data. Sometimes the scripts…

  • Mac OS X Server

    Change Log Paths In OS X Server 5

    The logs in Xcode Server (Server 5 for El Capitan and Yosemite) by default point to /Library/Server/XcodeLogs/credserver.log. This takes all of the output from xcscredd and xcscredhandler. If you’re doing a lot of debugging then logs can be pointed to another location, such as another drive. The path to the logs is defined in the /Applications/Server.app/Contents/ServerRoot/System/Library/LogConfiguration directory. The file to edit is a standard property list, XCSCredentialServer.plist: <?xml version=”1.0″ encoding=”UTF-8″?> <!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”> <plist version=”1.0″> <dict> <key>claimedFacilities</key> <array> <string>servermgrd</string> <string>servermgr-listener</string> <string>servermgr-notify</string> </array> <key>claimedSenders</key> <array> <string>servermgrd</string> <string>servermgr-listener</string> <string>servermgr-notify</string> </array> <key>logMaximumLevel</key> <string>debug</string> <key>logPath</key> <string>/Library/Server/Logs/servermgrd.log</string> </dict> </plist> Once open, look for a key called logPath. Change that to the…