Skip to content

Can't get Laravel logs through stdout of Docker Container #9

Open
@fernandomullerjr

Description

@fernandomullerjr

Hello everyone,
i am trying to get logs from Laravel through the stdout of my travellist-app Container, but when i simulate and error inside the container:

fernando@c64d676157c2:/var/www$ php artisan command5
Command "command5" is not defined.  
fernando@c64d676157c2:/var/www$ 

The error is writed in laravel.log:

fernando@c64d676157c2:/var/www$ tail storage/logs/laravel.log
"} 
[2022-02-22 12:43:52] dev.ERROR: Command "command5" is not defined. {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"command5\" is not defined. at /var/www/vendor/symfony/console/Application.php:644)
[stacktrace]
#0 /var/www/vendor/symfony/console/Application.php(228): Symfony\\Component\\Console\\Application->find('command5')
#1 /var/www/vendor/symfony/console/Application.php(140): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#2 /var/www/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#3 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#4 /var/www/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#5 {main}
"} 
fernando@c64d676157c2:/var/www$ 

But the error is not showed in stdout of the travellist-app Container:

fernando@notebookdell-1487   /lab/treinamento/travellist-laravel-demo     main   docker logs -f travellist-app                                                               SIGINT(2) ↵  10345  09:44:30  
[22-Feb-2022 12:40:57] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[22-Feb-2022 12:40:57] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[22-Feb-2022 12:40:57] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[22-Feb-2022 12:40:57] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[22-Feb-2022 12:40:57] NOTICE: fpm is running, pid 1
[22-Feb-2022 12:40:57] NOTICE: ready to handle connections

I tried a lot of combinations of configurations of php.ini file, config/logging.php, LOG_CHANNEL of .env, many options of stack configuration and much more.

I am using the PHP version 7.4.28.
laravel/framework v7.11.0
Composer version 2.2.6

All the containers are up and running:

fernando@notebookdell-1487   /lab/treinamento/travellist-laravel-demo     main   docker container ls                                                                                     10344  09:40:58  
CONTAINER ID   IMAGE          COMMAND                  CREATED         STATUS         PORTS                                   NAMES
c64d676157c2   travellist     "docker-php-entrypoi…"   5 seconds ago   Up 3 seconds   9000/tcp                                travellist-app
2995a82595f7   mysql:5.7      "docker-entrypoint.s…"   5 seconds ago   Up 3 seconds   3306/tcp, 33060/tcp                     travellist-db
736ede87e337   nginx:alpine   "/docker-entrypoint.…"   5 seconds ago   Up 3 seconds   0.0.0.0:8000->80/tcp, :::8000->80/tcp   travellist-nginx
 fernando@notebookdell-1487   /lab/treinamento/travellist-laravel-demo     main                                                                                                           10345  09:41:01  

How can i get the logs from Laravel in the stdout of my Docker Container?
Really appreciate any help with this matter.
Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions