I have a module that records the user's IP on the debug log when he visits the page "example.com/iplog/index/test
".
My module is located in the app/code/IpLog folder and contains the modules.xml, registration.php, routes.xml and controller files.
Ip log example:
[2019-05-13 21:53:03] main.DEBUG: 127.0.0.1 05/13/2019 09:53:03 pm [] []
I want this action (IP logging) to happen when the user enters the main page on the site "example.com". How can I execute the module this way?