Use combined as a default for $format_log
This commit is contained in:
parent
03aa252e1c
commit
c25c957a65
2 changed files with 11 additions and 19 deletions
|
@ -219,7 +219,7 @@ define nginx::resource::vhost (
|
||||||
$include_files = undef,
|
$include_files = undef,
|
||||||
$access_log = undef,
|
$access_log = undef,
|
||||||
$error_log = undef,
|
$error_log = undef,
|
||||||
$format_log = undef,
|
$format_log = 'combined',
|
||||||
$passenger_cgi_param = undef,
|
$passenger_cgi_param = undef,
|
||||||
$log_by_lua = undef,
|
$log_by_lua = undef,
|
||||||
$log_by_lua_file = undef,
|
$log_by_lua_file = undef,
|
||||||
|
@ -456,14 +456,10 @@ define nginx::resource::vhost (
|
||||||
# This was a lot to add up in parameter list so add it down here
|
# This was a lot to add up in parameter list so add it down here
|
||||||
# Also opted to add more logic here and keep template cleaner which
|
# Also opted to add more logic here and keep template cleaner which
|
||||||
# unfortunately means resorting to the $varname_real thing
|
# unfortunately means resorting to the $varname_real thing
|
||||||
$access_log_tmp = $access_log ? {
|
$access_log_real = $access_log ? {
|
||||||
undef => "${nginx::config::log_dir}/${name_sanitized}.access.log",
|
'off' => 'off',
|
||||||
default => $access_log,
|
undef => "${nginx::config::log_dir}/${name_sanitized}.access.log ${format_log}",
|
||||||
}
|
default => "${access_log} ${format_log}",
|
||||||
|
|
||||||
$access_log_real = $format_log ? {
|
|
||||||
undef => $access_log_tmp,
|
|
||||||
default => "${access_log_tmp} ${format_log}",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$error_log_real = $error_log ? {
|
$error_log_real = $error_log ? {
|
||||||
|
@ -571,14 +567,10 @@ define nginx::resource::vhost (
|
||||||
# This was a lot to add up in parameter list so add it down here
|
# This was a lot to add up in parameter list so add it down here
|
||||||
# Also opted to add more logic here and keep template cleaner which
|
# Also opted to add more logic here and keep template cleaner which
|
||||||
# unfortunately means resorting to the $varname_real thing
|
# unfortunately means resorting to the $varname_real thing
|
||||||
$ssl_access_log_tmp = $access_log ? {
|
$ssl_access_log_real = $access_log ? {
|
||||||
undef => "${nginx::config::log_dir}/ssl-${name_sanitized}.access.log",
|
'off' => 'off',
|
||||||
default => $access_log,
|
undef => "${nginx::config::log_dir}/ssl-${name_sanitized}.access.log ${format_log}",
|
||||||
}
|
default => "${access_log} ${format_log}",
|
||||||
|
|
||||||
$ssl_access_log_real = $format_log ? {
|
|
||||||
undef => $ssl_access_log_tmp,
|
|
||||||
default => "${ssl_access_log_tmp} ${format_log}",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ssl_error_log_real = $error_log ? {
|
$ssl_error_log_real = $error_log ? {
|
||||||
|
|
|
@ -229,7 +229,7 @@ describe 'nginx::resource::vhost' do
|
||||||
:title => 'should set access_log',
|
:title => 'should set access_log',
|
||||||
:attr => 'access_log',
|
:attr => 'access_log',
|
||||||
:value => '/path/to/access.log',
|
:value => '/path/to/access.log',
|
||||||
:match => ' access_log /path/to/access.log;',
|
:match => ' access_log /path/to/access.log combined;',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:title => 'should set error_log',
|
:title => 'should set error_log',
|
||||||
|
@ -484,7 +484,7 @@ describe 'nginx::resource::vhost' do
|
||||||
:title => 'should set access_log',
|
:title => 'should set access_log',
|
||||||
:attr => 'access_log',
|
:attr => 'access_log',
|
||||||
:value => '/path/to/access.log',
|
:value => '/path/to/access.log',
|
||||||
:match => ' access_log /path/to/access.log;',
|
:match => ' access_log /path/to/access.log combined;',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:title => 'should set error_log',
|
:title => 'should set error_log',
|
||||||
|
|
Loading…
Reference in a new issue