Home

StandardOutPath

StandardOutPath is a key used in launchd property lists on macOS to redirect a launched process’s standard output to a file. It is typically used together with StandardErrorPath to separately route standard error. The value of StandardOutPath is an absolute filesystem path to a file where stdout will be written for the lifetime of the job.

When a launchd job starts, its stdout is redirected to the file specified by StandardOutPath. The corresponding

Common practice is to direct logs to files under /var/log or a dedicated log directory, with separate

Example plist snippet:

<dict>

<key>Label</key>

<string>com.example.daemon</string>

<key>ProgramArguments</key>

<array><string>/usr/bin/mydaemon</string></array>

<key>RunAtLoad</key><true/>

<key>StandardOutPath</key><string>/var/log/mydaemon.out</string>

<key>StandardErrorPath</key><string>/var/log/mydaemon.err</string>

</dict>

StandardInPath, a related key, can similarly redirect standard input. Together, these keys help manage a daemon’s

StandardErrorPath
key
controls
where
standard
error
is
written.
If
you
set
StandardOutPath
or
StandardErrorPath
to
/dev/null,
the
respective
output
is
discarded.
The
permissions
of
the
target
file
and
directory
must
allow
the
launchd
service
to
write
to
them;
otherwise
the
job
may
fail
to
start
or
the
output
may
not
be
captured.
files
for
stdout
and
stderr
to
aid
debugging
and
monitoring.
Administrators
should
consider
log
rotation
and
disk
space
management
to
prevent
unbounded
growth.
I/O
by
isolating
it
from
the
parent
process
and
enabling
centralized
logging.