I am trying to learn Monolog and I am following this tutorial: https://stackify.com/php-monolog-tutorial/
It says
First, when you create a logger, channel name should be included, so that you can distinguish your list of loggers.
$logger = new MonologLogger('channel-name'); $app->container->logger = $logger;
In the example above, ‘channel-name’ should be included in every log entry. This way you can easily look up and filter the entries; create another channel for each component. Examples of these channels might include ‘database’, ‘security’, ’business’, and others.
So what exactly are channels and how should I use them?
The "channel" here is not a generic PHP concept, it's just a term that monolog uses for a category of messages which you want to log.
From the monolog usage documentation:
You can create many Loggers, each defining a channel (e.g.: db, request, router, ..) and each of them combining various handlers, which can be shared or not. The channel is reflected in the logs and allows you to easily see or filter records.
Further down that page, there is another section on using channels:
Channels are a great way to identify to which part of the application a record is related. This is useful in big applications (and is leveraged by MonologBundle in Symfony).
Picture two loggers sharing a handler that writes to a single log file. Channels would allow you to identify the logger that issued every record. You can easily grep through the log files filtering this or that channel.