WORK IN PROGRESS
With the advent of AULS (Apple Unified Logging System - 1 2 3), application developers are now free to totally stop logging to syslog built into macOS. This is great for them, bad if getting logs to an external logging service like Papertrail is still on the agenda.
This is where Axe comes in. The goal is to capture logs from Apple's Unified Logging System and send them to Papertrail. It's hacky and can probably be done more efficiently, but Apple has chosen to go the way of journald
with their own twist.
- macOS 10.12 (this is hard minimum requirement, 10.11 did not feature AULS)
- Ruby 2.2.1 (pre-installed; the goal is to add as few things as possible to the system to make this work)
(this doesn't do anything yet)
Run sudo install.sh
and it'll do the following:
- Copy
src/axe.rb
to/etc/papertrail/axe/axe.rb
- Copy
src/com.johnathanlyman.axe.plist
to/Library/LaunchDaemons/com.johnathanlyman.axe.plist
so it can be run - Load the Global Daemon
- Prompt for configuration params
- Write out the config file to
/etc/papertrail/axe/config.yml
- Start the Daemon
There are a few bits of information we'll need during the configuration step:
- Papertrail log destination and port (think
logsX.papertrailapp.com:YYYYY
), replacingX
andYYYYY
with what you find here or here. - Determine logging level. This is incredibly important. AULS is chatty. Like really chatty. Expect
DEBUG
to churn out 4-6000 messages per second.
- Support TLS. Currently logs are transmitted in plain-text TCP.
- Allow Axe to attempt a restart of either thread before giving up and dying.
launchd
will also attempt to restart so this might not be a big deal.
The MIT License is found here: License