From 07b3556510440f7b5f19e19cca1b46d9d581da43 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 14 Jan 2025 12:10:49 +0100 Subject: [PATCH] logind: improve log message we generate when a user logs in Mention the session type and class both in the human readable string and in the structured log. --- src/login/logind-session.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 686041320f3..e8c3ae621b2 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -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); -- 2.47.3