tchapi / davis

🗓 A simple, fully translatable admin interface for sabre/dav based on Symfony 5 and Bootstrap 5, initially inspired by Baïkal.

Home Page:https://github.com/users/tchapi/projects/1/views/1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logging directory with davis version 4.2.x

tiiiecherle opened this issue · comments

Hey,

I added the new variable LOG_FILE_PATH and my /PATH/TO/DAVIS/.env.local.php gets the following entry:

'LOG_FILE_PATH' => '%kernel.logs_dir%/%kernel.environment%.log',

but the expected file /PATH/TO/DAVIS/var/log/prod.log is not created and therefore there are no entries.

I don't know how to check if LOG_FILE_PATH is set correctly or if there are really no logs until now. Is there a way to force a log entry or an action that can be done in the administration GUI to produce a log entry?

Thanks

Hi @tiiiecherle

The logs are in "fingers crossed" mode when in production, meaning that it will only get logged when there is an actual error happening. Setting the app in dev mode with APP_ENV=dev should create a handful of logs in .'/var/log/dev.log' by just navigating the app.

Note
if you want to use the default log directory (the one you indicated here), you can remove the LOG_FILE_PATH env var altogether, too, as it's not needed

Hey @tchapi,

thanks for the fast response and the explanation.

If I delete the LOG_FILE_PATH all of these commands in my install/update script (not running in docker)

bin/console doctrine:schema:update --force --no-interaction
bin/console doctrine:migrations:sync-metadata-storage
bin/console doctrine:migrations:migrate --no-interaction

produce the following error

In EnvVarProcessor.php line 178:                                
Environment variable not found: "LOG_FILE_PATH".  

Thanks, setting APP_ENV=dev produces logs in /PATH/TO/DAVIS/var/log/dev.log

So I think these settings are correct.

'LOG_FILE_PATH' => '%kernel.logs_dir%/%kernel.environment%.log',

Thanks again. I guess the issue can be closed.