0

The step-debugger is working fine, no issues there.

Each time I'm working in VS code without listening to any incoming connections from xdebug, PHP writes this message to my logs when I refresh my page:

[06-Sep-2021 13:39:58 Europe/Brussels] Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: 10.1.2.4:9003 (from REMOTE_ADDR HTTP header), localhost:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(

Since I don't like deleting hundreds of irrelevant messages from my logs, I'm wondering if I can disable this particular message? I couldn't really find anything in the docs about this.

Overwriting the behavior using set_error_handler would be an option, but I'd like to keep it clean :)

DerpyNerd
  • 4,743
  • 7
  • 41
  • 92

1 Answers1

3

You can't do that for this message in Xdebug 3.0.

But in Xdebug 3.1 (beta1 to be released within the hour) you can set Xdebug's xdebug.log to a writable file (or perhaps even /dev/null, I haven't tried that). If an Xdebug log is active, then Xdebug will not direct these time-out messages to PHP's error mechanism any more, and hence they won't show up in the log.

This is the related issue: https://bugs.xdebug.org/view.php?id=1948

FWIW, you won't likely be able to use set_error_handler to do something here, as it's an internal Xdebug call that doesn't go through the PHP error mechanism.

Derick
  • 35,169
  • 5
  • 76
  • 99
  • Wow, an answer from the man himself in no time. Thanks a lot! For now I'll stick to overwriting the error handler since I like that stability of the main releases. The discussion also mentions PHP version 8.0.0-8.0.4. Not sure if it's relevant but I'm still on 7.4. It's good to know this request has already been included for future releases. – DerpyNerd Sep 06 '21 at 12:10
  • The error handler trick likely won't work. Xdebug 3.1 will support PHP 7.2 and up: https://xdebug.org/docs/compat – Derick Sep 06 '21 at 12:10
  • 1
    @DerpyNerd Also check out https://stackoverflow.com/a/65264131/783119 – LazyOne Sep 06 '21 at 14:30
  • Hi @LazyOne, that's a very good answer. I do have logging setup properly (log-file per subdirectory if needed) and Xdebug is setup to only connect to some of my coworkers and my computer. Like Derick said. I could disable xdebug logging for now tho. I hadn't even thought of the most simple solution :) – DerpyNerd Sep 06 '21 at 15:29