My webhoster has a folder called "logs" in the root directory of my website. This directory is read-only and only for logs of the webserver.
I can't install grav to the root, because grav does not let me change the default directory for logs (to e.g. grav_logs). It would be handy, if there was an option to change the default folder names.
This is already possible with setup.php and its configuration options. That is something I plan on documenting in the next few days.
I havn't tried yet, but adding
schemes:
log:
type: Stream
prefixes:
'': [grav_logs]
to the streams.yaml may also work. Since streams can be overloaded with other configurations. You may also try to save the above contents as a streams.yaml in your user/config directory.
EDIT: Placing the above contents in the user/config/streams.yaml works. :smile:
@Sommerregen Thanks a lot!
I just realized that if:
Grav will not work and throw an error /homepages/.../htdocs/logs exists but is not writeable.
Edit:
Changing defines.php line 19 to define('LOG_DIR', ROOT_DIR .'grav_log/'); does not fix this.
Some progress has been made in this respect, the assets, images, pages, data, plugins, themes folders can be relocated using streams. assets was added recently to the list, refer to https://github.com/getgrav/grav/pull/387 and https://github.com/getgrav/grav/pull/408.
However the CLIs still depend on hardcoded system, vendor and user folders, so those cannot yet be relocated. Same for the _problem_ plugin.
Maybe user, system and vendor (latter is used by composer and pretty much a given standard anyway) should be considered as _non-relocatable_.
This would leave only CACHE_DIR and LOG_DIR left to made relocatable/configurable.
I tried to tackle the LOG_DIR yesterday but gave up once I ran into a chicken/egg problem with the dependencies of locator, config and log services on each other and the order of their initialization. To change from a define in the log service one needs the locator service which again needs the config and stream services which again need the uri service and so forth. Seems not easy to de-couple those services from each other.
I had to revert #408 due to problems with bin/grav clear. The asset stream does not appear to be defined at this point by default. Need to dig deeper but don't want to leave the develop branch broken, so reverted it.
ok, should be working again now.
Yes. Please make this editable. Some hosts at the moment permission lock /log folder. For example 1and1.com
1and1.com fits the environment requirements for Grav otherwise since the PHP version can easily be changed.
Is this working then now? The replies are a bit ambiguous?
Ok I've been looking for it for a little while but I got exactly the same issue, as I'm on a shared server from 1and1 and the logs at the root can't be writable.
Is there anything that works already? I've been stuck with it for days now, and I would like to begin testing stuff online.
I successfully deployed my site to 1and1 by moving all the files to a directory and then pointing the domain to it. I also had to uncomment the line RewriteBase / to make an internal server error go away.
We would really like to move the system images folder somewhere to create an image directory at URL our_site_dot_com/images.
@kirillaristov You can copy system/config/streams.yaml to your site configuration and customize the folder from there.
@kirillaristov You can copy
system/config/streams.yamlto your site configuration and customize the folder from there.
Tried, didn't work...
Most helpful comment
I successfully deployed my site to 1and1 by moving all the files to a directory and then pointing the domain to it. I also had to uncomment the line
RewriteBase /to make an internal server error go away.