Chapters
23 Chapters
|
2:20:28
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
15.
Named Autowiring
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
This tutorial also works great for Symfony 6!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": "^7.3.0 || ^8.0.0",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "^1.11", // 1.11.99
"knplabs/knp-markdown-bundle": "^1.8", // 1.9.0
"sensio/framework-extra-bundle": "^6.0", // v6.2.1
"sentry/sentry-symfony": "^4.0", // 4.0.3
"symfony/asset": "5.0.*", // v5.0.11
"symfony/console": "5.0.*", // v5.0.11
"symfony/debug-bundle": "5.0.*", // v5.0.11
"symfony/dotenv": "5.0.*", // v5.0.11
"symfony/flex": "^1.3.1", // v1.21.6
"symfony/framework-bundle": "5.0.*", // v5.0.11
"symfony/monolog-bundle": "^3.0", // v3.6.0
"symfony/profiler-pack": "*", // v1.0.5
"symfony/routing": "5.1.*", // v5.1.11
"symfony/twig-pack": "^1.0", // v1.0.1
"symfony/var-dumper": "5.0.*", // v5.0.11
"symfony/webpack-encore-bundle": "^1.7", // v1.8.0
"symfony/yaml": "5.0.*" // v5.0.11
},
"require-dev": {
"symfony/maker-bundle": "^1.15", // v1.23.0
"symfony/profiler-pack": "^1.0" // v1.0.5
}
}
8 Comments
Wierd. At first the markdown channel didn't show up on the console in dev, then I changed to prod and it appeared. Then I commented the monolog.yaml dev file and the console started to show the markdown channel also in the dev env, at last I've uncommented the monolog.yaml dev file but the markdown stayed. I suppose it was cache related.
Hey Joao P.
Have you tried to run
clear:cachecommand after adding markdown channel? It's totally cache issue also it can be related to opcache if you have it enabled in your php configuration.Cheers!
I have tried clear:cache and it didn't work neither. It turns out I have placed the file in config directory not the child packages one.
also you can try restarting PHP workers, or the apache server depending on your configuration. In most cases, such an issue is cache related. Symfony caches all config files, and depending on OS and configuration from time to time you can face different issues with config files.
Cheers
Hint: in newer versions, isn't monology.yaml separated in dev and prod directiores. Now is only one file in packages directory. If add
channels: ['markdown']in
when@devit will working well.Definitely - new tricks in the latest version of Symfony! Thanks for making a note of that :)
FYI - if you add that
channelsunderwhen@dev, just be careful because the "markdown logger" service will only exist indev: when you switch toprod, that service won't exist... so you'll likely get an error. It's a bit safer to keepchannels: ['markdown']for all environments, but then don't use the "markdown" channel for anything special (e.g. don't log to its own file) in theprodenvironment.Cheers!
"php bin/console debug:autowiring log" shows only one service. I have added below the total scenario
<blockquote>Describes a logger instance.
Psr\Log\LoggerInterface (logger)</blockquote>
I dont find any monolog.logger in my app
Also profiler don't show any log message after adding this:-
`if (strpos($source, 'cat') !== false) {
}`
Problem solved. I had missed the monolog bundle installation.
"Houston: no signs of life"
Start the conversation!