[systemd-devel] [systemd-commits] man/journalctl.xml src/journal

Lennart Poettering lennart at poettering.net
Fri Aug 22 03:50:21 PDT 2014


On Fri, 22.08.14 01:57, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:

> 
> On Thu, Aug 21, 2014 at 05:16:37AM -0700, Harald Hoyer wrote:
> > @@ -276,6 +278,7 @@ static int parse_argv(int argc, char *argv[]) {
> >                  { "file",           required_argument, NULL, ARG_FILE           },
> >                  { "root",           required_argument, NULL, ARG_ROOT           },
> >                  { "header",         no_argument,       NULL, ARG_HEADER         },
> > +                { "identifier",     required_argument, NULL, 't'                },
> >                  { "priority",       required_argument, NULL, 'p'                },
> >                  { "setup-keys",     no_argument,       NULL, ARG_SETUP_KEYS     },
> >                  { "interval",       required_argument, NULL, ARG_INTERVAL       },
> > @@ -304,7 +307,7 @@ static int parse_argv(int argc, char *argv[]) {
> >          assert(argc >= 0);
> >          assert(argv);
> >  
> > -        while ((c = getopt_long(argc, argv, "hefo:aln::qmb::kD:p:c:u:F:xrM:", options, NULL)) >= 0)
> > +        while ((c = getopt_long(argc, argv, "hefo:aln::qmb::kD:p:c:t:u:F:xrM:", options, NULL)) >= 0)
> 
> Hi,
> 
> I think the addition is useful, but I'm not sure we want to immediately allocate
> the short option too. So far syslog identifier haven't been in much use, and
> 't' is a nice option name.

I think Harald has a point in that this would neatly mirror what
"systemd-cat" already supports... I'd vote for leaving it in.

I wasn't convinced by the patch at first, since it brings very little
new in comparison to simply specifying SYSLOG_IDENTIFIER=
instead. However, there are two reasons I ended up liking it: first,
because it does mirror systemd-cat nicely, but, more importantly, it's
actually a useful key to sort by that is shown in the usual journalctl
output, which none of the other usual keys are. This means that people
can look at the normal output, and immediately deduce a key to filter
by, something that for the other keys (includeing _SYSTEMD_UNIT=...)
requires them to invoke "journalctl -o verbose" first... Hence I think
it deserves being very easily accessible, including by short option...

I hope that makes some sense,

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list