Index: uspace/srv/sysman/Makefile
===================================================================
--- uspace/srv/sysman/Makefile	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/srv/sysman/Makefile	(revision 3f05ef78b4f8b389b4770defbab4631b556220e6)
@@ -43,4 +43,5 @@
 	dep.c \
 	job.c \
+	log.c \
 	sysman.c \
 	unit.c \
Index: uspace/srv/sysman/log.c
===================================================================
--- uspace/srv/sysman/log.c	(revision 3f05ef78b4f8b389b4770defbab4631b556220e6)
+++ uspace/srv/sysman/log.c	(revision 3f05ef78b4f8b389b4770defbab4631b556220e6)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015 Michal Koutny
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <assert.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <str_error.h>
+
+#include "log.h"
+
+static FILE *log_file = NULL;
+
+void sysman_log(log_level_t level, const char *fmt, ...)
+{
+	va_list args;
+	va_start(args, fmt);
+	
+	vprintf(fmt, args);
+	printf("\n");
+	if (log_file != NULL) {
+		vfprintf(log_file, fmt, args);
+		fprintf(log_file, "\n");
+		fflush(log_file);
+	}
+
+	va_end(args);
+}
+
+void sysman_log_tofile(void)
+{
+	assert(log_file == NULL);
+	log_file = fopen("/root/sysman.log", "a");
+	if (log_file == NULL) {
+		sysman_log(LVL_ERROR, "Failed opening logfile: %s", str_error(errno));
+	} else {
+		sysman_log(LVL_NOTE, "--- Begin sysman log ---");
+	}
+
+	assert(log_file != NULL);
+}
Index: uspace/srv/sysman/log.h
===================================================================
--- uspace/srv/sysman/log.h	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/srv/sysman/log.h	(revision 3f05ef78b4f8b389b4770defbab4631b556220e6)
@@ -37,5 +37,8 @@
  * that would use logger as soon as it's ready.
  */
-#define sysman_log(level, fmt, ...) printf("sysman: " fmt "\n", ##__VA_ARGS__)
+//#define sysman_log(level, fmt, ...) if(level > LVL_DEBUG2) printf("sysman: " fmt "\n", ##__VA_ARGS__)
 
+extern void sysman_log(log_level_t, const char *, ...) PRINTF_ATTRIBUTE(2, 3);
+
+extern void sysman_log_tofile(void);
 #endif
Index: uspace/srv/sysman/units/unit_mnt.c
===================================================================
--- uspace/srv/sysman/units/unit_mnt.c	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/srv/sysman/units/unit_mnt.c	(revision 3f05ef78b4f8b389b4770defbab4631b556220e6)
@@ -234,4 +234,7 @@
 	assert(unit->state == STATE_STOPPED || unit->state == STATE_STARTING);
 
+	if (str_cmp(unit_name(unit), "rootfs.mnt") == 0) {
+		sysman_log_tofile();
+	}
 	unit->state = STATE_STARTED;
 	unit_notify_state(unit);
