Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced log_by_lua and log_by_lua_file params. #300

Merged
merged 1 commit into from
Apr 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions manifests/resource/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,20 @@
# [*vhost_cfg_ssl_prepend*] - It expects a hash with custom directives to
# put before everything else inside vhost ssl
# [*rewrite_to_https*] - Adds a server directive and rewrite rule to
# rewrite to ssl
# rewrite to ssl
# [*include_files*] - Adds include files to vhost
# [*access_log*] - Where to write access log. May add additional
# options like log format to the end.
# options like log format to the end.
# [*error_log*] - Where to write error log. May add additional
# options like error level to the end.
# options like error level to the end.
# [*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:
#
# Requires:
Expand Down Expand Up @@ -183,6 +189,8 @@
$error_log = undef,
$format_log = undef,
$passenger_cgi_param = undef,
$log_by_lua = undef,
$log_by_lua_file = undef,
$use_default_location = true,
$rewrite_rules = [],
) {
Expand Down Expand Up @@ -314,6 +322,12 @@
if ($passenger_cgi_param != undef) {
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_array($rewrite_rules)

Expand Down
8 changes: 8 additions & 0 deletions templates/vhost/vhost_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ server {
<% if @index_files.count > 0 -%>
index <% Array(@index_files).each do |i| %> <%= i %><% 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 %>;
error_log <%= @error_log_real %>;
Expand Down