]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: improve log message we generate when a user logs in 35987/head
authorLennart Poettering <lennart@poettering.net>
Tue, 14 Jan 2025 11:10:49 +0000 (12:10 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 15 Jan 2025 16:03:21 +0000 (17:03 +0100)
Mention the session type and class both in the human readable string and
in the structured log.

src/login/logind-session.c

index 686041320f3adedb9c551df8a82c6b0794891f6c..e8c3ae621b2ff435c114d459afcdcb3a19b8e305 100644 (file)
@@ -859,7 +859,13 @@ int session_start(Session *s, sd_bus_message *properties, sd_bus_error *error) {
                    "SESSION_ID=%s", s->id,
                    "USER_ID=%s", s->user->user_record->user_name,
                    "LEADER="PID_FMT, s->leader.pid,
-                   LOG_MESSAGE("New session %s of user %s.", s->id, s->user->user_record->user_name));
+                   "CLASS=%s", session_class_to_string(s->class),
+                   "TYPE=%s", session_type_to_string(s->type),
+                   LOG_MESSAGE("New session '%s' of user '%s' with class '%s' and type '%s'.",
+                               s->id,
+                               s->user->user_record->user_name,
+                               session_class_to_string(s->class),
+                               session_type_to_string(s->type)));
 
         if (!dual_timestamp_is_set(&s->timestamp))
                 dual_timestamp_now(&s->timestamp);