Merge pull request #300 from hdanes/feature/log_by_lua_file
Introduced log_by_lua and log_by_lua_file params.
This commit is contained in:
commit
fbb71f222b
2 changed files with 26 additions and 4 deletions
|
@ -106,6 +106,12 @@
|
||||||
# options like error level to the end.
|
# options like error level to the end.
|
||||||
# [*passenger_cgi_param*] - Allows one to define additional CGI environment
|
# [*passenger_cgi_param*] - Allows one to define additional CGI environment
|
||||||
# variables to pass to the backend application
|
# variables to pass to the backend application
|
||||||
|
# [*log_by_lua*] - Run the Lua source code inlined as the
|
||||||
|
# <lua-script-str> at the log request processing phase.
|
||||||
|
# This does not replace the current access logs, but runs after.
|
||||||
|
# [*log_by_lua_file*] - Equivalent to log_by_lua, except that the file
|
||||||
|
# specified by <path-to-lua-script-file> contains the Lua code, or, as from
|
||||||
|
# the v0.5.0rc32 release, the Lua/LuaJIT bytecode to be executed.
|
||||||
# Actions:
|
# Actions:
|
||||||
#
|
#
|
||||||
# Requires:
|
# Requires:
|
||||||
|
@ -183,6 +189,8 @@ define nginx::resource::vhost (
|
||||||
$error_log = undef,
|
$error_log = undef,
|
||||||
$format_log = undef,
|
$format_log = undef,
|
||||||
$passenger_cgi_param = undef,
|
$passenger_cgi_param = undef,
|
||||||
|
$log_by_lua = undef,
|
||||||
|
$log_by_lua_file = undef,
|
||||||
$use_default_location = true,
|
$use_default_location = true,
|
||||||
$rewrite_rules = [],
|
$rewrite_rules = [],
|
||||||
) {
|
) {
|
||||||
|
@ -314,6 +322,12 @@ define nginx::resource::vhost (
|
||||||
if ($passenger_cgi_param != undef) {
|
if ($passenger_cgi_param != undef) {
|
||||||
validate_hash($passenger_cgi_param)
|
validate_hash($passenger_cgi_param)
|
||||||
}
|
}
|
||||||
|
if ($log_by_lua != undef) {
|
||||||
|
validate_string($log_by_lua)
|
||||||
|
}
|
||||||
|
if ($log_by_lua_file != undef) {
|
||||||
|
validate_string($log_by_lua_file)
|
||||||
|
}
|
||||||
validate_bool($use_default_location)
|
validate_bool($use_default_location)
|
||||||
validate_array($rewrite_rules)
|
validate_array($rewrite_rules)
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,14 @@ server {
|
||||||
<% if @index_files.count > 0 -%>
|
<% if @index_files.count > 0 -%>
|
||||||
index <% Array(@index_files).each do |i| %> <%= i %><% end %>;
|
index <% Array(@index_files).each do |i| %> <%= i %><% end %>;
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
<% if defined? @log_by_lua -%>
|
||||||
|
log_by_lua '<%= @log_by_lua %>';
|
||||||
|
<% end -%>
|
||||||
|
<% if defined? @log_by_lua_file -%>
|
||||||
|
log_by_lua_file "<%= @log_by_lua_file %>";
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
access_log <%= @access_log_real %>;
|
access_log <%= @access_log_real %>;
|
||||||
error_log <%= @error_log_real %>;
|
error_log <%= @error_log_real %>;
|
||||||
|
|
Loading…
Reference in a new issue