Needs work
Project:
Link checker
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Jan 2020 at 10:22 UTC
Updated:
19 Aug 2021 at 06:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jeroentPatch attached removes the function
linkchecker_watchdog_logand replaces it with a dedicated service.Comment #3
jeroentComment #4
jeroentFixed some coding standards.
Comment #5
dsdeiz commentedOh nice, yeah this does seem way better. I tested this manually and seems like I'm not getting the messages on watchdog or perhaps is it logging somewhere else? Changing the service to this seem to do the trick:
Also changing the
linkcontext to this:Would tests also help? I can work on it if necessary but probably just basing it on
RulesLoggerChannelTest(seems to be the only basis I can find which provides a customLoggerChannel).Comment #6
dsdeiz commentedComment #7
jeroent@dsdeiz,
The reason I removed the factory is
\Drupal\Core\Logger\LoggerChannelFactoryline 34.:$instance = new LoggerChannel($channel);When you add that line, the service won't use our
\Drupal\linkchecker\Logger\LinkCheckerLogger. but will use the LoggerChannel we want to extend. Also which messages that should be logged are configurable:If you could add testing, that would benefit this issue a lot!
Comment #8
dsdeiz commentedOh right, yeah. It doesn't seem to log to watchdog though even if I have set it to log all messages. I think the logs are created but are just not sent to watchdog or perhaps there needs to be a way to render the sent logs similar to #3104109: Implement rendering of debug logs to screen and database. Or perhaps I'm just missing something.
Yeah, will see if I am able to implement this.
Comment #9
dsdeiz commentedYeah, sorry, guess I'm not sure how to do this. Tried to base it here but can't get it to work.
Putting it back to "Needs review" for others more familiar on how to test this.
Comment #10
c-logemannThe patch doesn't apply anymore. I think this is just because of last changes with othe huge code cleanups. So patch needs to be fixed in the next step.
Comment #11
tomefa commentedUpdate Patch for the last dev branch code.
Comment #12
tomefa commentedComment #13
jeroentPatch no longer applies since #3109158: Check if LINKCHECKER_DEFAULT_FILTER_BLACKLIST is still needed and remove it was committed.
Comment #14
jeroentComment #15
joelpittetComment #16
c-logemannThe patch applies and I set setting Log level to "Debug messages" but there no messages in my test system after I retriggered link extraction etc. Di I miss something or is there is something missed in the new strategy?
Comment #17
jeroent@C_Loggeman,
You're right, there seems something wrong with patch #14. I created a new one.
Comment #18
eiriksmCan we get the type hint and argument type to be Psr\Log\LoggerInterface instead? This patch will break sites if you use another library for logging (for example monolog).
Also, would be nice to have a test or two?😉️ I am thinking a test that proves that the log level chosen logs, and run that with and without the function removed?
Comment #19
jeroent