Menu

#114 journald integration issues

v7.8
closed
nobody
None
5
2023-07-22
2023-02-14
No

the journalctl documentation is not accurate and will not work for most items.

The following generally will work:

LogFile = 
LogFile = none
*JournalCtl = "--output=cat --unit=servicename.service"

To make the documentation accurate line 1426:

         if ($FileList[0] eq 'none') {
 ```

 Would have to be changed to something like:
   if (grep(/^none$/,@FileList)) {

```

But not sure of the impacts of that change so not sure it is a correct solution.

What I would really like to see is a way to simply set a global config setting like:

JOURNALD=1

Then based on that flag for all the config files the appropriate thing is done for each supported log file.

Tried to modify the code with that in mind but to many things started to do unexpected stuff so used the above config change instead for the few config files I needed.

Related

Bugs: #114

Discussion

  • Jason Pyeron

    Jason Pyeron - 2023-02-15

    Kyle – thoughts?

    From: bugs@logwatch.p.re.sourceforge.net [mailto:bugs@logwatch.p.re.sourceforge.net] On Behalf Of Matthew McGillis
    Sent: Tuesday, February 14, 2023 6:24 PM
    To: Ticket #114: journald integration issues 114@bugs.logwatch.p.re.sourceforge.net
    Subject: [logwatch:bugs] #114 journald integration issues


    [bugs:#114] https://sourceforge.net/p/logwatch/bugs/114/ journald integration issues

    Status: open
    Group: v7.8
    Created: Tue Feb 14, 2023 11:24 PM UTC by Matthew McGillis
    Last Updated: Tue Feb 14, 2023 11:24 PM UTC
    Owner: nobody

    the journalctl documentation is not accurate and will not work for most items.

    The following generally will work:

    LogFile =
    LogFile = none
    *JournalCtl = "--output=cat --unit=servicename.service"

    To make the documentation accurate line 1426:

         if ($FileList[0] eq 'none') {
    

    ```

    Would have to be changed to something like:
    if (grep(/^none$/,@FileList)) {

    ```

    But not sure of the impacts of that change so not sure it is a correct solution.

    What I would really like to see is a way to simply set a global config setting like:

    JOURNALD=1

    Then based on that flag for all the config files the appropriate thing is done for each supported log file.

    Tried to modify the code with that in mind but to many things started to do unexpected stuff so used the above config change instead for the few config files I needed.


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/logwatch/bugs/114/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #114

  • Bjorn

    Bjorn - 2023-05-21

    What I think you are asking for is a global variable to use journalctl, rather than specifying it on each service.

    But there are two difficulties:

    • First, to address the solution of searching for 'none' in the FileList: some services that use LogFile = none do so because they really don't have any log files, not because their output can be obtained through journalctl (such as all the zz-* services).

    • Second, the servicename used by journalctl is not necessarily the same one used by Logwatch. And Logwatch keys the services off of the configuration filename. So you'd still need a per-service variable to match the Logwatch and systemd services.

    So the answer is that you still need to specify for each service configuration file how to use the journalctl command, and specifying all the options, including the service name (as is currently implemented) provides a more universal solution.

    (If your question is whether 'none' can be part of a larger string: the statement LogFile = with no actual value resets its value to a null equivalent.)

     
  • Bjorn

    Bjorn - 2023-07-22
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB