title: How to log incoming requests to Playwright Chromium server with NodeJS?
body: <p>I would like all incoming requests to a playwright chromium server to be written to the console.</p>
  <p>This code was supposed to do the job:</p>
  <pre><code>  // NODEJS SERVER
    const browserServer = await chromium.launchServer({
      headless: false,
      port: 9904,
      logger: {
        isEnabled: (name, severity) =&gt; name === 'browser',
        log: (name, severity, message, args) =&gt; console.log(`${name} ${message}`)
      }
    })
  
  // NODEJS CLIENT CONSOLE APP
  const browser = await chromium.connect({
    wsEndpoint: &quot;SERVER ENDPOINT&quot;
  })
  const page = await browser.newPage()
  </code></pre>
  <p>The serve code is running fine - it opens Chrome whenever a request is being sent from the client app, however, no log is written to the console. Basically, I can't track how many requests were sent to the server, as an example.</p>
  <p>Playwright documentation barely have examples for BrowserType.launchServer() method.</p>
  <p>Any help is very much appretiated. Thanks!</p>
  <p><strong>For those with the same issue, I found a workaround myself</strong></p>
  <p>In the logger parameter of launchServer, instead of filtering log events by name=&quot;browser&quot;, just set isEnabled to true to capture all sort of events. From there, you can capture a &quot;protocol&quot; event called &quot;Target.createBrowserContext&quot;, which means a client has requested the remote server to open Chrome and perform a test. Unfortunately, chromium.connect() does not generate any event on the server side, instead, browser.newPage() will. That's the closest event you can capture after chromium.connect() is performed and will indicate server activities in the log.</p>