Unnecessary dependency on Database Logging module

Created on 29 August 2024, 3 months ago
Updated 13 September 2024, 2 months ago

Problem/Motivation

The restfullogger module has a dependency on the core Database Logging module. However it should not care, which logger implementation is being used. The restfullogger just gets its logger channel from the logger factory service. Currently, there is no way to use this module with just the core Syslog module.

Proposed resolution

Remove the dependency on the Database Logging module.

✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States lkacenja

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @lkacenja
  • Pipeline finished with Success
    3 months ago
    Total: 148s
    #268421
  • πŸ‡ΊπŸ‡ΈUnited States lkacenja

    I made sure the module works with neither core logger backend installed. With a fresh D10 installation, I installed restfullogger only. In the console I ran:

    // Get the CSRF token.
    $.ajax({
      url: '/session/token',
       success: (data) => {console.log(data);},
    });
    
    
    // Use the logger.
    $.ajax({
      type: 'POST',
      url: '/dblog/logger?_format=json',
      headers: {
        'Content-Type': 'application/json',
        'X-CSRF-Token': '<insert token>',
      },
      data: JSON.stringify({
        'message': 'Test message',
        'path': '/',
        'severity': 'notice',
      }),
      success: () => {console.log('yay!');},
      dataType:'application/json',
    });
    

    This worked as expected. The log message succeeds and fires the content off into space. I then installed and configured syslog and the same two steps resulted in the logs being sent to the designated log file.

  • Status changed to Needs review 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States greggles Denver, Colorado, USA

    Makes sense and LGTM. Thanks!

  • Status changed to RTBC 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    This looks good to me as well. The restfullogger.info.yml fail is not related.
    Unable to parse modules/custom/restfullogger-3471039/restfullogger.info.yml Unexpected characters near " || ^11" at line 4 (near "core_version_requirement: ">=8" || ^11").

  • Pipeline finished with Success
    3 months ago
    Total: 236s
    #268491
  • πŸ‡ΊπŸ‡ΈUnited States greggles Denver, Colorado, USA

    This MR could also fix the cspell soft-failure by adding a _CSPELL_WORDS line with something like:

    variables:
      _CSPELL_WORDS: 'restfulloger, rymcveigh'
    

    This would need the variables: section to be uncommented or added as well.

  • Pipeline finished with Success
    3 months ago
    Total: 139s
    #268502
  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    This MR could also fix the cspell soft-failure by adding a _CSPELL_WORDS line

    I went ahead and added the _CSPELL_WORDS variable in this commit.

  • πŸ‡ΊπŸ‡ΈUnited States greggles Denver, Colorado, USA

    Excellent. Looks like there's a big fail now, but maybe that's more of an infrastructure problem?

  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    I adjusted the file using the new version of the gitlab-ci template and it did the job. I'm going to go ahead and merge these changes.

  • Pipeline finished with Skipped
    3 months ago
    #268659
  • Status changed to Fixed 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh
  • πŸ‡ΊπŸ‡ΈUnited States greggles Denver, Colorado, USA

    Nice catch! I was confused by the fails yesterday. Glad you figured that out.

    And with these changes the pipelines are all so very happy https://git.drupalcode.org/project/restfullogger/-/pipelines/268656

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024