In D7 is used to log using Watchdog function. In D8, I see its gone and I should use something called the logging API.
What I a trying to do:
- I have created a menu/route,
mysite.com/logmessage
- When user opens that url in browser, I want to log "hello" to the dblog.
Where should I register the service that D8 documentation says to do? Is it in the services.yml file in sites/default
folder?
Can I just load the said class in my controller/module file and call the function for logging? Or should I explicitly extend the class first in my module before using the function?