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.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lkacenja created an issue. See original summary.

lkacenja’s picture

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.

greggles’s picture

Status: Active » Needs review

Makes sense and LGTM. Thanks!

rymcveigh’s picture

Status: Needs review » Reviewed & tested by the community

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").

greggles’s picture

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.

rymcveigh’s picture

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.

greggles’s picture

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

rymcveigh’s picture

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.

  • rymcveigh committed 9047448d on 2.0.x authored by lkacenja
    Issue #3471039 by lkacenja: Unnecessary dependency on Database Logging...
rymcveigh’s picture

Status: Reviewed & tested by the community » Fixed
greggles’s picture

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

Status: Fixed » Closed (fixed)

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