aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-10-17 22:01:37 +0200
committerJakob Unterwurzacher2018-10-17 22:18:03 +0200
commit3cd892ccdee9cef6e2fd9ad14cb12f643e4a6fb3 (patch)
tree8fbf21edde137d928fee4db528acf2dce43f75e4
parent0751b4e00a3cbb7e940e39d76abadd21aadcd16c (diff)
main: also redirect Fatal logger to syslog on daemonization
The messages would still be collected via gocryptfs-logger, but let's do it right. Before: Oct 17 21:58:12 brikett gocryptfs[9926]: testing info Oct 17 21:58:12 brikett gocryptfs[9926]: testing warn Oct 17 21:58:12 brikett gocryptfs-9926-logger[9935]: testing fatal After: Oct 17 22:00:53 brikett gocryptfs[10314]: testing info Oct 17 22:00:53 brikett gocryptfs[10314]: testing warn Oct 17 22:00:53 brikett gocryptfs[10314]: testing fatal
-rw-r--r--mount.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/mount.go b/mount.go
index b4b6e61..5bdaa51 100644
--- a/mount.go
+++ b/mount.go
@@ -116,6 +116,7 @@ func doMount(args *argContainer) {
tlog.Info.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_INFO)
tlog.Debug.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_DEBUG)
tlog.Warn.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_WARNING)
+ tlog.Fatal.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_CRIT)
tlog.SwitchLoggerToSyslog(syslog.LOG_USER | syslog.LOG_WARNING)
// Daemons should redirect stdin, stdout and stderr
redirectStdFds()