summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Pugh2018-03-26 16:16:05 (GMT)
committerJon Pugh2018-03-26 16:16:05 (GMT)
commit5ea918ae72f4f0390299bbcb7d38a04a2d622a42 (patch)
tree4024fe0097cd3ada4f82835cae664e04926db862
parentfe683e4804bcaa0c1277544eb0545191da14f6bf (diff)
In vhost template, populate extra_config using new servicesInvoke() method.
-rw-r--r--src/Provision/Service/Http/Apache/Configuration/SiteConfigFile.php3
-rw-r--r--src/Provision/Service/Http/HttpApacheDockerService.php17
2 files changed, 19 insertions, 1 deletions
diff --git a/src/Provision/Service/Http/Apache/Configuration/SiteConfigFile.php b/src/Provision/Service/Http/Apache/Configuration/SiteConfigFile.php
index c86797f..8aed5c2 100644
--- a/src/Provision/Service/Http/Apache/Configuration/SiteConfigFile.php
+++ b/src/Provision/Service/Http/Apache/Configuration/SiteConfigFile.php
@@ -45,7 +45,8 @@ class SiteConfigFile extends ConfigFile {
$this->data['db_port'] = $this->context->getSubscription('db')->service->getCreds()['port'];
- $this->data['extra_config'] = '';
+ $extra_apache_configs = $this->getContext()->servicesInvoke('extraApacheConfig', [$this]);
+ $this->data['extra_config'] = implode("\n", $extra_apache_configs);
// if ($this->aliases && !is_array($this->aliases)) {
// $this->aliases = explode(",", $this->aliases);
diff --git a/src/Provision/Service/Http/HttpApacheDockerService.php b/src/Provision/Service/Http/HttpApacheDockerService.php
index 12eadc4..6aa6f43 100644
--- a/src/Provision/Service/Http/HttpApacheDockerService.php
+++ b/src/Provision/Service/Http/HttpApacheDockerService.php
@@ -453,4 +453,21 @@ ENV;
$environment['SERVER_NAME'] = $this->provider->name;
return $environment;
}
+
+ /**
+ * Output additional configuration to the virtualhost config file.
+ * @param $configFile
+ *
+ * @return string
+ */
+ function extraApacheConfig($configFile) {
+
+ $lines[] = " # Write all logs to the logfile. the default entrypoint tails this file.";
+ $lines[] = ' ErrorLogFormat "ERROR | %v [%t] [client %a] [%l] %M';
+ $lines[] = ' LogFormat "ACCESS | %v %t [client %a] [%>s] [%b bytes] %r" custom';
+
+ $lines[] = " ErrorLog /var/log/provision.log ";
+ $lines[] = " CustomLog /var/log/provision.log custom";
+ return implode("\n", $lines);
+ }
}