October 2017
Intermediate to advanced
566 pages
14h 31m
English
I mentioned earlier how we can define our own logger channel so that we don't have to always inject the entire factory. So, let's take a look at how to create one for the Hello World module we're now writing.
Most of the time, all we have to do is add the following definition to our hello_world.services.yml file:
hello_world.logger.channel.hello_world: parent: logger.channel_base arguments: ['hello_world']
Before talking about the actual logger channel, let's see what this weird service definition actually means because this is not something we've seen before--I mean, where's the class?
The parent key means that our service will inherit the definition from another service. In our case, the parent key is logger.channel_base ...
Read now
Unlock full access