I created a new Magento 2 module and followed the injection-based logger object creation.
public function __construct(\Psr\Log\LoggerInterface $logger)
Now, when I log using this logger, I get it logged as module main. e.g.
[2019-08-22 10:42:02] main.INFO: message ...
I presume, the main is the root logger. How can I create my logger, so that instead of main, it will print my module name every time?
This is pretty standard practice in java to create a logger for the given class or package so that you can control the logging levels per package. I don't even want to control the level, at least this will help me grep for my messages in my log. How can I achieve this?