1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-24 14:50:17 +03:00

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.
This commit is contained in:
Lennart Poettering 2025-01-14 12:10:49 +01:00
parent ef5f72437e
commit 07b3556510

View 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);