Bug 8722 - logdrake does not work with system-journald
Summary: logdrake does not work with system-journald
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard: 3beta2
Keywords: PATCH
: 8030 (view as bug list)
Depends on:
Blocks: 8039
  Show dependency treegraph
 
Reported: 2013-01-17 14:03 CET by Derek Jennings
Modified: 2013-05-01 17:18 CEST (History)
5 users (show)

See Also:
Source RPM: drakxtools-15.19-1.mga3
CVE:
Status comment:


Attachments
Logdrake with systemd-journald function (83.68 KB, image/png)
2013-01-17 14:08 CET, Derek Jennings
Details
Patch for logdrake to read system-journald (6.42 KB, patch)
2013-01-17 14:28 CET, Derek Jennings
Details | Diff
Revised with improved layout (6.91 KB, patch)
2013-01-17 23:53 CET, Derek Jennings
Details | Diff
Tidier version (7.77 KB, patch)
2013-02-11 00:04 CET, Derek Jennings
Details | Diff

Description Derek Jennings 2013-01-17 14:03:30 CET
logdrake does not work with system-journald, and rsyslog is not installed by default in mga3 so unless the user knows to install rsyslog then logdrake will appear to be broken.


Since this is probably a low priority for devs I have modified logdrake myself to work with both system-journald and conventional log files. Patch to follow.
Comment 1 Derek Jennings 2013-01-17 14:08:34 CET
Created attachment 3390 [details]
Logdrake with systemd-journald function

On left hand side are log files to view. The 'system log' is actually journald. Any file not present is greyed out.

Priority level filters on  log level priority in journald.
Comment 2 Derek Jennings 2013-01-17 14:28:10 CET
Created attachment 3391 [details]
Patch for logdrake to read system-journald

I am sure this could be coded better, but it seems to work OK
Derek Jennings 2013-01-17 14:30:14 CET

Keywords: (none) => PATCH
Whiteboard: (none) => 3beta2

Comment 3 Derek Jennings 2013-01-17 23:53:11 CET
Created attachment 3393 [details]
Revised with improved layout

Improved version with better layout for small screens

Attachment 3391 is obsolete: 0 => 1

Comment 4 Manuel Hiebel 2013-01-18 21:41:52 CET
dups but I will keeps yours

CC: (none) => mageia, thierry.vignaud
Blocks: (none) => 8039

Comment 5 Manuel Hiebel 2013-01-18 21:42:07 CET
*** Bug 8030 has been marked as a duplicate of this bug. ***

CC: (none) => marc.lattemann

Comment 6 Nicolas Lécureuil 2013-02-05 22:52:13 CET
- /usr/sbin/logdrake	2013-01-16 21:18:34.000000000 +0000
+++ logdrake	2013-01-17 22:45:15.000000000 +0000
@@ -61,9 +61,10 @@
 my $mday = (localtime(time()))[3];
 $cal->select_day($mday);
 my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
-my $cal_mode = 0;
-my $cal_butt = gtksignal_connect(Gtk2::CheckButton->new(N("Show only for the selected day")), clicked => sub { $cal_mode = !$cal_mode; gtkset_sensitive($cal,$cal_mode) });
-
+my @monthsdecimal = qw(01 02 03 04 05 06 07 08 09 10 11 12);
+my $cal_mode = 1;
+#my $cal_butt = gtksignal_connect(Gtk2::CheckButton->new(N("Show only for the selected day")), clicked => sub { $cal_mode = !$cal_mode; gtkset_sensitive($cal,$cal_mode) });
+gtkset_sensitive($cal,$cal_mode);

why do you have commented this code ?


110,10 +111,17 @@
 	     "auth" => { file => "/var/log/auth.log", desc => N("_:this is the auth.log log file\nAuthentication") },
 	     "user" => { file => "/var/log/user.log", desc => N("_:this is the user.log log file\nUser") },
 	     "messages" => { file => "/var/log/messages", desc => N("_:this is the /var/log/messages log file\nMessages") },
-	     "syslog" => { file => "/var/log/syslog", desc => N("_:this is the /var/log/syslog log file\nSyslog") },
+	     "syslog" => { file => "/usr/bin/journalctl", desc => N("_:this is the main system journal\nSystem log") },

this should handle when rsyslog is installed and used because here you "force" the use of journalctl whereas we still can use rsyslog.


-							     1, gtkadd(gtkset_border_width(Gtk2::Frame->new(N("Choose file")),2),
+							     1, gtkadd(gtkset_border_width(Gtk2::Frame->new(N("Log File")),2),

i don't know about this, the previous sentence was OK ( but this is not an important remark here )

CC: (none) => nicolas.lecureuil

Comment 7 Derek Jennings 2013-02-10 14:32:26 CET
(In reply to comment #6)
> +#my $cal_butt = gtksignal_connect(Gtk2::CheckButton->new(N("Show only for the
> selected day")), clicked => sub { $cal_mode = !$cal_mode;
> gtkset_sensitive($cal,$cal_mode) });
> +gtkset_sensitive($cal,$cal_mode);
> 
> why do you have commented this code ?
> 

Because logdrake always required the 'Show only for selected day' checkbox to be selected. If it was unselected then it nevers shows any results. There is no point having a checkbox that always has to be selected. Also removing the checkbox saves on vertical space which is useful on a small screen.

I should have removed the line instead of just commenting it.


> 
> 110,10 +111,17 @@
>           "auth" => { file => "/var/log/auth.log", desc => N("_:this is the
> auth.log log file\nAuthentication") },
>           "user" => { file => "/var/log/user.log", desc => N("_:this is the
> user.log log file\nUser") },
>           "messages" => { file => "/var/log/messages", desc => N("_:this is the
> /var/log/messages log file\nMessages") },
> -         "syslog" => { file => "/var/log/syslog", desc => N("_:this is the
> /var/log/syslog log file\nSyslog") },
> +         "syslog" => { file => "/usr/bin/journalctl", desc => N("_:this is the
> main system journal\nSystem log") },
> 
> this should handle when rsyslog is installed and used because here you "force"
> the use of journalctl whereas we still can use rsyslog.
> 

Yes. You are correct. I was assuming that journalctl would always be available and even if rsyslogd was available it was preferable to search journalctl because it can be filtered by date range and message type without having to parse the entire file.



> 
> -                                 1,
> gtkadd(gtkset_border_width(Gtk2::Frame->new(N("Choose file")),2),
> +                                 1,
> gtkadd(gtkset_border_width(Gtk2::Frame->new(N("Log File")),2),
> 
> i don't know about this, the previous sentence was OK ( but this is not an
> important remark here )

I agree. It makes little difference.
Comment 8 Derek Jennings 2013-02-11 00:04:32 CET
Created attachment 3509 [details]
Tidier version

Is this better?

If systemd-journald is running selecting 'syslog' will search  with journalctl
if not then it behaves as before and will search /var/log/syslog

Attachment 3390 is obsolete: 0 => 1
Attachment 3393 is obsolete: 0 => 1

Comment 9 Thierry Vignaud 2013-02-20 21:22:11 CET
Don't remove the N() calls (you're breaking the translations)
Also why do you remove some conf stuff?
Why do you remove the settings frame?
About the "only this day" feature, I don't see why it couldn't be make to work with journald

This should be done incrementally and thus split into smaller bits:
- journald support
- handling priority
- removing frames (which I don't agree with)
Comment 10 Nicolas Lécureuil 2013-03-02 01:36:33 CET
for rsyslog, i think this should be available but "greyed" if rsyslog isn't installed.
Comment 11 Colin Guthrie 2013-04-29 18:26:51 CEST
As I won't have time to do much about this before release, I've simply added some code (subsequently tidied by Thierry) that ensures a syslog-daemon is installed. It's not ideal, but I think it's OK as a stop-gap to a full reimplementation as a journal viewer!

@Derek your help here is *really* appreciated. I think if the patch was tidied up as Thierry suggested we could look into merging it (in part at least), but this is unlikely to happen before release.

Also FYI, we will be moving the drakxtools to git shortly after MGA3 release so this should make contributing easier :)
Comment 12 Anne Nicolas 2013-05-01 17:18:17 CEST
I've added some explanations in release notes. 

Tested here it works properly, meaning all gray when rsyslog is not installed but ok when in the contrary

Status: NEW => RESOLVED
CC: (none) => ennael1
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.