nanobox-io/nanobox-engine-php

Custom logs not watched on local/dev

lyondhill opened this issue · 5 comments

From @mbrodala on December 15, 2016 9:40

Here's an excerpt from my boxfile.yml:

# ...
web.site:
  # ...

  log_watch:
    apache[access]: /data/var/log/apache/access.log
    apache[error]: /data/var/log/apache/error.log
    php[error]: /data/var/log/php/php_error.log
    php[fpm]: /data/var/log/php/php_fpm.log
    typo3[typo3]: var/log/typo3.log
    # ...

However, only the apache and php logs are watched and outputted on nanbox run php-server, the typo3 log is ignored. Is there anything I missed?

Copied from original issue: nanobox-io/nanobox#299

From @mbrodala on December 15, 2016 9:42

I can see the following after nanobox run:

/app $ ps aux | grep tail
gonano     136  0.0  0.0   6044   716 ?        S+   09:36   0:00 tail -f -n0 /data/var/log/php/php_error.log /data/var/log/php/php_fpm.log /data/var/log/apache/access.log /data/var/log/apache/error.log

So it looks like my custom log was indeed ignored.

From @danhunsaker on December 15, 2016 11:27

This is actually because the web instance isn't being created in the first place - dev mode doesn't spin up separate containers for webs and workers, instead spinning up one container for each app's console. So any settings in the web.* or worker.* sections aren't applied in development mode; they'll only kick in when deployed to dry-run or production.

From @mbrodala on December 15, 2016 11:37

I guess this makes sense; even php-server is invoked manually and no network_dirs are set up (not neccessary).

But still I can see log output on nanobox run php-server; would it be possible to include custom logs here? Just as minor feature request. Of course I can open/tail the app logs on my host system if not. ;-)

From @danhunsaker on December 15, 2016 11:48

I'd enjoy that as well. I'll have a peek at the engine repo and see if I can tweak the script any. The big trouble will be parsing the Boxfile - that isn't generally done outside the build/compile phases.

From @danhunsaker on December 15, 2016 11:57

Ah. Well. php-server is generated from a template. While the Boxfile is accessible. That shouldn't be too tricky to work with to give this additional functionality, though I'll probably have to look at it tomorrow or so.