Container, LoggerFactory class not found

Hi All,
Message: Class “App\Factory\LoggerFactory” not found
File: D:\Applications\wamp64\www\my-indloo\config\container.php
Line: 82

This drives me crazy for the past day and I have no clue where that issue comes from. For me the code I have so far points out the place where LoggerFactory class is available at.

Context: I tried to follow @Odan’s suggestion on logging functionality implementation.

Project’s folders structure:
- config
- logs
- public
- src
—–…
—–Factory
———….
———LoggerFactory.php
- vendor

LoggerFactory.php

<?php
use ……
final class LoggerFactory {
...

} ?>

My container looks like this:

container.php

use App\Factory\LoggerFactory;
…..
    // logger
    LoggerFactory::class => function (ContainerInterface $container) {
 (line 82)       return new LoggerFactory($container->get('settings')['logger']);

?>

composer.json:

    "require": {
        "slim/slim": "^4.15",
        "slim/psr7": "^1.7",
        "php-di/php-di": "^7.1",
        "cakephp/database": "^5.2",
        "slim/twig-view": "^3.4",
        "odan/session": "^6.4",
        "monolog/monolog": "^3.9"
    },

    "autoload": {
        "psr-4": {
            "Slim\\": "Slim",
            "App\\": "src/",
            "Test\\": "tests/"
        }
    }

Any tips how to overcome this is more than welcome.
TIA,
Kuba

Ok, found it. I’m embarrassed. I forgot to add a namespace in the LoggerFactory.php file.

1 Like