After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691785 - Import libgsystemlog, use it to log "milestones" to systemd journal
Import libgsystemlog, use it to log "milestones" to systemd journal
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-01-15 14:33 UTC by Colin Walters
Modified: 2013-03-27 01:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-configure-Fix-with-have-systemd-confusion.patch (846 bytes, patch)
2013-01-15 14:33 UTC, Colin Walters
committed Details | Review
0001-Import-libgsystemlog-use-it-to-log-milestones-to-sys.patch (10.51 KB, patch)
2013-01-15 14:34 UTC, Colin Walters
reviewed Details | Review
0001-Use-sd_journal_send-to-log-key-events-with-MESSAGE_I.patch (3.63 KB, patch)
2013-01-16 03:20 UTC, Colin Walters
accepted-commit_now Details | Review

Description Colin Walters 2013-01-15 14:33:21 UTC
The key here with the use of the journal is that we include
    MESSAGE_ID, which allows the gnome-ostree test scripts (and others) to
    look for these.
Comment 1 Colin Walters 2013-01-15 14:33:56 UTC
Created attachment 233525 [details] [review]
0001-configure-Fix-with-have-systemd-confusion.patch
Comment 2 Colin Walters 2013-01-15 14:34:13 UTC
Created attachment 233526 [details] [review]
0001-Import-libgsystemlog-use-it-to-log-milestones-to-sys.patch
Comment 3 Colin Walters 2013-01-15 16:30:33 UTC
See http://git.gnome.org/browse/gnome-ostree/tree/src/ostbuild/js/builtins/qa_smoketest.js for example code that can parse these message IDs.
Comment 4 Ray Strode [halfline] 2013-01-15 18:01:43 UTC
Review of attachment 233525 [details] [review]:

looks okay
Comment 5 Ray Strode [halfline] 2013-01-15 18:12:09 UTC
Review of attachment 233526 [details] [review]:

I can see this is a very targetted patch to achieve an end goal (interoperability with your testing framework). That's fine, but before too long we're going to need to integrate journald more deeply.

::: gnome-session/gsystem-log-syslog.c
@@ +37,3 @@
+  va_end (args);
+
+  syslog (priority, "%s", msg);

I'm not sure  a syslog fallback is a good idea. People have gotten cranky before when gnome-session spew showed up in their syslog. I realize we aren't completely syslog clean, atm.
Comment 6 Colin Walters 2013-01-15 18:27:24 UTC
(In reply to comment #5)
> Review of attachment 233526 [details] [review]:
> 
> I can see this is a very targetted patch to achieve an end goal
> (interoperability with your testing framework). That's fine, but before too
> long we're going to need to integrate journald more deeply.

Integrating more deeply is definitely a goal, and I also consider this patch an opening to that conversation.  Realistically though, the plan starts from gdm I think, which brings us back to:

https://bugzilla.gnome.org/show_bug.cgi?id=676181

> ::: gnome-session/gsystem-log-syslog.c

> I'm not sure  a syslog fallback is a good idea. People have gotten cranky
> before when gnome-session spew showed up in their syslog. I realize we aren't
> completely syslog clean, atm.

Hmm, yes, I recall that in the context of GConf, right?  Ah yes:
https://bugzilla.gnome.org/show_bug.cgi?id=126468

Dunno...what exactly we log and how much is clearly a vague topic, but the main complaint there I think was about "spam" - here in the normal default case, we're logging one message per session.  Doesn't seem too problematic to me...
Comment 7 Ray Strode [halfline] 2013-01-15 21:27:28 UTC
yea tbug 126468 and bug 672801 and others.

A lot of people want session logs to stay in the session log and not go into the system log.  Of course this is only relevant for fallback.
Comment 8 Colin Walters 2013-01-15 22:16:45 UTC
(In reply to comment #7)
> yea tbug 126468 and bug 672801 and others.
> 
> A lot of people want session logs to stay in the session log and not go into
> the system log. 

syslog is definitely not set up for being spammed, it's true.  But the current patch here is just writing one line per login.

> Of course this is only relevant for fallback.

By "fallback" do you mean syslog-based systems?
Comment 9 Colin Walters 2013-01-16 03:20:41 UTC
Created attachment 233567 [details] [review]
0001-Use-sd_journal_send-to-log-key-events-with-MESSAGE_I.patch

Ok, after a high bandwidth discussion with Ray, we concluded something like this patch is better for now.