Add logging customization to the main logs as well.

This commit is contained in:
Todd Eddy 2013-08-07 21:27:13 -04:00
parent 8cb8a31ade
commit 70207c9a65
4 changed files with 12 additions and 3 deletions

View file

@ -27,7 +27,9 @@ class nginx::config(
$proxy_http_version = $nginx::params::nx_proxy_http_version,
$types_hash_max_size = $nginx::params::nx_types_hash_max_size,
$types_hash_bucket_size = $nginx::params::nx_types_hash_bucket_size,
$http_cfg_append = $nginx::params::nx_http_cfg_append
$http_cfg_append = $nginx::params::nx_http_cfg_append,
$nginx_error_log = $nginx::params::nx_nginx_error_log,
$http_access_log = $nginx::params::nx_http_access_log,
) inherits nginx::params {
File {
owner => 'root',

View file

@ -44,6 +44,8 @@ class nginx (
$mail = $nginx::params::nx_mail,
$server_tokens = $nginx::params::nx_server_tokens,
$http_cfg_append = $nginx::params::nx_http_cfg_append,
$nginx_error_log = $nginx::params::nx_nginx_error_log,
$http_access_log = $nginx::params::nx_http_access_log,
$nginx_vhosts = {},
$nginx_upstreams = {},
$nginx_locations = {},
@ -68,6 +70,8 @@ class nginx (
confd_purge => $confd_purge,
server_tokens => $server_tokens,
http_cfg_append => $http_cfg_append,
nginx_error_log => $nginx_error_log,
http_access_log => $http_access_log,
require => Class['nginx::package'],
notify => Class['nginx::service'],
}

View file

@ -84,4 +84,7 @@ class nginx::params {
$nx_http_cfg_append = false
$nx_nginx_error_log = "${nx_logdir}/error.log"
$nx_http_access_log = "${nx_logdir}/access.log"
}

View file

@ -1,7 +1,7 @@
user <%= scope.lookupvar('nginx::config::nx_daemon_user') %>;
worker_processes <%= @worker_processes %>;
error_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/error.log;
error_log <%= @nginx_error_log %>;
pid <%= scope.lookupvar('nginx::params::nx_pid')%>;
events {
@ -14,7 +14,7 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/access.log;
access_log <%= @http_access_log %>;
sendfile <%= scope.lookupvar('nginx::params::nx_sendfile')%>;