From bc0ce7b820eca834f1454deb09cb176a5e8b716e Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 6 Jul 2015 21:45:49 +0200 Subject: [PATCH] launchd: Log to files --- etc/macosx-launchd/README.md | 8 +++++--- etc/macosx-launchd/syncthing.plist | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/etc/macosx-launchd/README.md b/etc/macosx-launchd/README.md index 685c97657..b5249c2ae 100644 --- a/etc/macosx-launchd/README.md +++ b/etc/macosx-launchd/README.md @@ -4,9 +4,8 @@ background under Mac OS X. 1. Install the `syncthing` binary in a directory called `bin` in your home directory. - 2. Edit the `syncthing.plist` file in the two places that refer to your - home directory; that is, replace `/Users/jb` with your actual home - directory location. + 2. Edit the `syncthing.plist` by replacing `USERNAME` with your actual + username such as `jb`. 3. Copy the `syncthing.plist` file to `~/Library/LaunchAgents`. @@ -15,3 +14,6 @@ background under Mac OS X. You probably want to turn off "Start Browser" among the settings to avoid it opening a browser window on each login. + +Logs are in `~/Library/Logs/Syncthing.log` and, for crashes and exceptions, +`~/Library/Logs/Syncthing-Error.log`. diff --git a/etc/macosx-launchd/syncthing.plist b/etc/macosx-launchd/syncthing.plist index 3112b2600..f4bcd7611 100644 --- a/etc/macosx-launchd/syncthing.plist +++ b/etc/macosx-launchd/syncthing.plist @@ -1,5 +1,11 @@ + Label @@ -7,13 +13,13 @@ ProgramArguments - /Users/jb/bin/syncthing + /Users/USERNAME/bin/syncthing EnvironmentVariables HOME - /Users/jb + /Users/USERNAME STNORESTART 1 @@ -26,5 +32,11 @@ ProcessType Background + + StandardOutPath + /Users/USERNAME/Library/Logs/Syncthing.log + + StandardErrorPath + /Users/USERNAME/Library/Logs/Syncthing-Errors.log