summaryrefslogtreecommitdiff
path: root/src/basic/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/log.c')
-rw-r--r--src/basic/log.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/basic/log.c b/src/basic/log.c
index f8ef751a93..f24431eef2 100644
--- a/src/basic/log.c
+++ b/src/basic/log.c
@@ -1337,3 +1337,13 @@ int log_dup_console(void) {
console_fd = copy;
return 0;
}
+
+void log_setup_service(void) {
+ /* Sets up logging the way it is most appropriate for running a program as a service. Note that using this
+ * doesn't make the binary unsuitable for invocation on the command line, as log output will still go to the
+ * terminal if invoked interactively. */
+
+ log_set_target(LOG_TARGET_AUTO);
+ log_parse_environment();
+ log_open();
+}