Index: uspace/lib/c/generic/io/log.c
===================================================================
--- uspace/lib/c/generic/io/log.c	(revision 1c67b414600c56792079a7c6f1384f7977abcb71)
+++ uspace/lib/c/generic/io/log.c	(revision eab3d0480f33fbfac5b74bb7b810c256b8cb688d)
@@ -52,5 +52,6 @@
 	"note",
 	"debug",
-	"debug2"
+	"debug2",
+	NULL
 };
 
@@ -179,4 +180,33 @@
 }
 
+int log_level_from_str(const char *name, log_level_t *level_out)
+{
+	log_level_t level = LVL_FATAL;
+
+	while (log_level_names[level] != NULL) {
+		if (str_cmp(name, log_level_names[level]) == 0) {
+			if (level_out != NULL)
+				*level_out = level;
+			return EOK;
+		}
+		level++;
+	}
+
+	/* Maybe user specified number directly. */
+	char *end_ptr;
+	int level_int = strtol(name, &end_ptr, 0);
+	if ((end_ptr == name) || (str_length(end_ptr) != 0))
+		return EINVAL;
+	if (level_int < 0)
+		return ERANGE;
+	if (level_int >= (int) LVL_LIMIT)
+		return ERANGE;
+
+	if (level_out != NULL)
+		*level_out = (log_level_t) level_int;
+
+	return EOK;
+}
+
 /** Initialize the logging system.
  *
Index: uspace/lib/c/generic/io/logctl.c
===================================================================
--- uspace/lib/c/generic/io/logctl.c	(revision 1c67b414600c56792079a7c6f1384f7977abcb71)
+++ uspace/lib/c/generic/io/logctl.c	(revision eab3d0480f33fbfac5b74bb7b810c256b8cb688d)
@@ -84,12 +84,11 @@
 		return EINVAL;
 
-	char level_str[10];
-	str_cpy(level_str, 10, (const char *) argument);
+	char level_str[20];
+	str_cpy(level_str, 20, (const char *) argument);
 
-	int level_int = strtol(level_str, NULL, 0);
-
-	log_level_t boot_level = (log_level_t) level_int;
-	if (boot_level >= LVL_LIMIT)
-		return EINVAL;
+	log_level_t boot_level;
+	int rc = log_level_from_str(level_str, &boot_level);
+	if (rc != EOK)
+		return rc;
 
 	if (level != NULL)
Index: uspace/lib/c/include/io/log.h
===================================================================
--- uspace/lib/c/include/io/log.h	(revision 1c67b414600c56792079a7c6f1384f7977abcb71)
+++ uspace/lib/c/include/io/log.h	(revision eab3d0480f33fbfac5b74bb7b810c256b8cb688d)
@@ -51,4 +51,5 @@
 
 extern const char *log_level_str(log_level_t);
+extern int log_level_from_str(const char *, log_level_t *);
 
 extern bool __log_shall_record(log_level_t);
