title: how to print file name in log in node js
body: <p>could you please tell me how to print <strong>file name</strong> in log in node js.it always print <code>index.js</code> why ?</p>
  
  <p>here is my code
  <a href="https://codesandbox.io/s/elegant-bassi-ij2e9" rel="nofollow noreferrer">https://codesandbox.io/s/elegant-bassi-ij2e9</a></p>
  
  <p>[![enter image description here][1]][1]</p>
  
  <pre><code>format: format.combine(
      format.label({ label: path.basename(process.mainModule.filename) }),
      format.timestamp({
        format: "DD-MM-YYYY HH:mm:ss"
      }),
  
    [1]: https://i.stack.imgur.com/SVmNe.png
  </code></pre>
  
  <p>expected</p>
  
  <pre><code>08-01-2020 03:29:33 info [test.js]: --dddabcbbc-
  </code></pre>
  
  <p>why <code>test.js</code> is not printed as I mention log in test.js</p>
  
  <p>any update?</p>