Skip to content

Commit 260b0d6

Browse files
committed
fixing merge conflicts
2 parents 52bbfcd + 641935c commit 260b0d6

File tree

8 files changed

+289
-65
lines changed

8 files changed

+289
-65
lines changed

README.rdoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This module provides a re-usable and environment agnostic control of Repose Powe
1111
$api_protocol = 'https'
1212
$api_host = "api-internal.${::domain}"
1313
$api_port = '443'
14-
$api_uri = "${api_protocol}://${api_host}/${app_name}"
14+
$api_uri = "${api_protocol}://${api_host}/${app_name}"
1515
$repose_nodes = [ "repose-n01.${::domain}",
1616
"repose-n02.${::domain}" ]
1717

@@ -26,15 +26,14 @@ This module provides a re-usable and environment agnostic control of Repose Powe
2626

2727
# Your http logging definitions
2828
$log_files = [
29-
{ 'id' => 'http-log',
30-
'format' => "Response Code Modifiers=%200,201U\tModifier Negation=%!401a\tRemote IP=%a\tLocal IP=%A\tResponse Size(bytes)=%b",
31-
'location' => "/var/log/repose/http_repose.log",
29+
{ 'id' => 'http',
30+
'format' => 'Response Code Modifiers=%200,201U\tModifier Negation=%!401a\tRemote IP=%a\tLocal IP=%A\tResponse Size(bytes)=%b',
3231
},
3332
]
3433

3534
# Your definitions for the system model
3635
$filters = {
37-
10 => { 'name' => 'http-logging' },
36+
10 => { 'name' => 'slf4j-http-logging' },
3837
20 => { 'name' => 'client-auth',
3938
'uri-regex' => "/${app_name}/.*" },
4039
30 => { 'name' => 'default-router' },
@@ -51,7 +50,7 @@ This module provides a re-usable and environment agnostic control of Repose Powe
5150

5251
# Bringing it all together
5352
class { 'repose::valve': }
54-
repose::filter::http_logging { 'default':
53+
repose::filter::slf4j_http_logging { 'default':
5554
log_files => $log_files,
5655
}
5756
repose::filter::client_auth_n { 'default':

manifests/filter/container.pp

Lines changed: 105 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,55 @@
1313
# String. Application name. Required
1414
# Defaults to <tt>undef</tt>
1515
#
16+
# [*artifact_directory*]
17+
# String.
18+
# Defaults to <tt>/usr/share/repose/filters</tt>
19+
#
20+
# [*artifact_directory_check_interval*]
21+
# Integer. Directory check interval in milliseconds.
22+
# Defaults to <tt>60000</tt>
23+
#
24+
# [*client_request_logging*]
25+
# Bool. Logs communication between repose and the end service
26+
# Defaults to <tt>false</tt>
27+
#
28+
# [*content_body_read_limit*]
29+
# Integer. Maximum size ofr request content in bytes
30+
# Defaults to <tt>undef</tt>
31+
#
32+
# [*deployment_directory*]
33+
# String. A string that points the directory where artifacts are extracted.
34+
# Defaults to <tt>/var/repose</tt>
35+
#
36+
# [*deployment_directory_auto_clean*]
37+
# Boolean. Set to true to clean up undeployed resources.
38+
# Defaults to <tt>true</tt>
39+
#
40+
# [*jmx_reset_time*]
41+
# Integer. The number of seconds the JMX reporting service keeps
42+
# data. The data will be reset after this amount of time.
43+
# Defaults to <tt>undef</tt>
44+
#
45+
# [*log_access_facility*]
46+
# String. The facility to use when sending access logs via syslog.
47+
# Defaults to <tt>local1</tt>
48+
#
49+
# [*log_access_local*]
50+
# Boolean. Should repose access logs be logged locally. Uses the log_local_*
51+
# Settings to determine retention policy.
52+
# Defaults to <tt>true</tt>
53+
#
54+
# [*log_access_local_name*]
55+
# String. The name of the local log file to be created for the local http
56+
# access logs. The name is appended with .log.
57+
# Defaults to <tt>http_repose</tt>
58+
#
59+
# [*log_access_syslog*]
60+
# Boolean. Should repose access logs be to a syslog. Uses the syslog_*
61+
# Settings to determine where to send the logs. You must also specify
62+
# a syslog_server in order for this to be enabled.
63+
# Defaults to <tt>true</tt>
64+
#
1665
# [*log_dir*]
1766
# String. Log file directory
1867
# Defaults to <tt>/var/log/repose</tt>
@@ -21,6 +70,33 @@
2170
# String. Default log level
2271
# Defaults to <tt>WARN</tt>
2372
#
73+
# [*log_local_policy*]
74+
# String. Log policy for repose.log and http_access.log. Default setting uses
75+
# the log4j DailyRollingFileAppender with a suffix of .yyyy-MM-dd. Can be one
76+
# of <tt>date</tt>,<tt>size</tt>,<tt>undef</tt>. If set to size, the logs
77+
# are rotated based on size and use the <tt>log_local_size</tt> and
78+
# <tt>log_local_rotation_count</tt> for determining retention. If set to
79+
# <tt>undef</tt> or anything other than <tt>date</tt> or <tt>size</tt>
80+
# the NullAppender is used which means it won't log.
81+
# Defaults to <tt>date</tt>
82+
#
83+
# [*log_local_size*]
84+
# String. The max file size for the log4j RollingFileAppender.
85+
# Defaults to <tt>100M</tt>
86+
#
87+
# [*log_local_rotation_count*]
88+
# Integer. The number of backup files to keeo for the log4j RollingFileAppender
89+
# Defaults to <tt>4</tt>
90+
#
91+
# [*log_repose_facility*]
92+
# String. The logging facility to send repose logs to when sending to a syslog
93+
# server.
94+
# Defaults to <tt>local0</tt>
95+
#
96+
# [*logging_configuration*]
97+
# String. The name of the logging configuration file.
98+
# Defaults to <tt>log4j.properties</tt>
99+
#
24100
# [*syslog_server*]
25101
# String. If this host is provided, the repose log4j configuration will ship
26102
# the repose.log to syslog (facility LOCAL0) and a http logger is created
@@ -35,30 +111,6 @@
35111
# String. The protocol to send syslog traffic as. Should be 'tcp' or 'udp'.
36112
# Defaults to <tt>udp</tt>
37113
#
38-
# [*via*]
39-
# String. String used in the Via header.
40-
# Defaults to <tt>undef</tt>
41-
#
42-
# [*deployment_directory*]
43-
# String. A string that points the directory where artifacts are extracted.
44-
# Defaults to <tt>/var/repose</tt>
45-
#
46-
# [*deployment_directory_auto_clean*]
47-
# Boolean. Set to true to clean up undeployed resources.
48-
# Defaults to <tt>true</tt>
49-
#
50-
# [*artifact_directory*]
51-
# String.
52-
# Defaults to <tt>/usr/share/repose/filters</tt>
53-
#
54-
# [*artifact_directory_check_interval*]
55-
# Integer. Directory check interval in milliseconds.
56-
# Defaults to <tt>60000</tt>
57-
#
58-
# [*logging_configuration*]
59-
# String. The name of the logging configuration file.
60-
# Defaults to <tt>log4j.properties</tt>
61-
#
62114
# [*ssl_enabled*]
63115
# Boolean. Enable ssl configuration for the container.
64116
# Defaults to <tt>false</tt>
@@ -75,19 +127,10 @@
75127
# String. The password for the particular application key in the keystore.
76128
# Defaults to <tt>undef</tt>
77129
#
78-
# [*content_body_read_limit*]
79-
# Integer. Maximum size ofr request content in bytes
80-
# Defaults to <tt>undef</tt>
81-
#
82-
# [*jmx_reset_time*]
83-
# Integer. The number of seconds the JMX reporting service keeps
84-
# data. The data will be reset after this amount of time.
130+
# [*via*]
131+
# String. String used in the Via header.
85132
# Defaults to <tt>undef</tt>
86133
#
87-
# [*client_request_logging*]
88-
# Bool. Logs communication between repose and the end service
89-
# Defaults to <tt>false</tt>
90-
#
91134
# [*http_port*]
92135
# DEPRECATED. This attribute is deprecated and will be ignored. This has
93136
# moved to the system-model configuration.
@@ -123,24 +166,33 @@
123166
class repose::filter::container (
124167
$ensure = present,
125168
$app_name = undef,
126-
$log_dir = $repose::params::logdir,
127-
$log_level = $repose::params::log_level,
128-
$syslog_server = undef,
129-
$syslog_port = $repose::params::syslog_port,
130-
$syslog_protocol = $repose::params::syslog_protocol,
131-
$via = undef,
132-
$deployment_directory = $repose::params::deployment_directory,
133-
$deployment_directory_auto_clean = true,
134169
$artifact_directory = $repose::params::artifact_directory,
135170
$artifact_directory_check_interval = 60000,
171+
$client_request_logging = undef,
172+
$content_body_read_limit = undef,
173+
$deployment_directory = $repose::params::deployment_directory,
174+
$deployment_directory_auto_clean = true,
175+
$jmx_reset_time = undef,
176+
$log_access_facility = $repose::params::log_access_facility,
177+
$log_access_local = $repose::params::log_access_local,
178+
$log_access_local_name = $repose::params::log_access_local_name,
179+
$log_access_syslog = $repose::params::log_access_syslog,
180+
$log_dir = $repose::params::logdir,
181+
$log_level = $repose::params::log_level,
182+
$log_local_policy = $repose::params::log_local_policy,
183+
$log_local_size = $repose::params::log_local_size,
184+
$log_local_rotation_count = $repose::params::log_local_rotation_count,
185+
$log_repose_facility = $repose::params::log_repose_facility,
136186
$logging_configuration = $repose::params::logging_configuration,
137187
$ssl_enabled = false,
138188
$ssl_keystore_filename = undef,
139189
$ssl_keystore_password = undef,
140190
$ssl_key_password = undef,
141-
$content_body_read_limit = undef,
142-
$jmx_reset_time = undef,
143-
$client_request_logging = undef,
191+
$syslog_server = undef,
192+
$syslog_port = $repose::params::syslog_port,
193+
$syslog_protocol = $repose::params::syslog_protocol,
194+
$via = undef,
195+
# BELOW ARE DEPRECATED
144196
$http_port = undef,
145197
$https_port = undef,
146198
$connection_timeout = undef,
@@ -149,6 +201,13 @@
149201
) inherits repose::params {
150202

151203
### Validate parameters
204+
validate_bool($log_access_local)
205+
validate_bool($log_access_syslog)
206+
validate_string($log_access_facility)
207+
validate_string($log_dir)
208+
validate_string($log_level)
209+
validate_string($log_access_local_name)
210+
validate_string($log_syslog_facility)
152211

153212
## ensure
154213
if ! ($ensure in [ present, absent ]) {

manifests/filter/http_logging.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# == Resource: repose::filter::http_logging
22
#
3+
# *DEPRECATED* THIS FILTER HAS BEEN DEPRECATED.
4+
# This filter has been replaced with the slf4j http logging filter. Please
5+
# update to use repose::filters::slf4j_http_logging
36
# This is a resource for generating http logging configuration files
47
#
58
# === Parameters
@@ -55,6 +58,7 @@
5558
$filename = 'http-logging.cfg.xml',
5659
$log_files = undef,
5760
) {
61+
warning('repose::filter::http_logging has been deprecated')
5862

5963
### Validate parameters
6064

manifests/params.pp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,27 @@
153153
## default log level
154154
$log_level = 'WARN'
155155

156+
## default local log policy
157+
$log_local_policy = 'date'
158+
159+
## default local log size
160+
$log_local_size = '100M'
161+
162+
## default local log rotation count
163+
$log_local_rotation_count = 4
164+
165+
## default repose.log syslog facility
166+
$log_repose_facility = 'local0'
167+
168+
## default http access log syslog facility
169+
$log_access_facility = 'local1'
170+
171+
## default access logging locally
172+
$log_access_local = true
173+
174+
## default access log local filename
175+
$log_access_local_name = 'http_repose'
176+
177+
## default access logging to syslog
178+
$log_access_syslog = true
156179
}

puppet-module-repose.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ cp -pr * %{buildroot}%{module_dir}/
2929
%{module_dir}
3030

3131
%changelog
32+
* Tue Sep 15 2014 Alex Schultz <[email protected]> - 1.0.7-1
33+
- Deprecation of http-logging filter, updates to log4j to support slf4j logging
3234
* Tue Jun 03 2014 Alex Schultz <[email protected]> - 1.0.6-1
3335
- Fixing minor logic issues, adding spec tests
3436
* Mon May 19 2014 Alex Schultz <[email protected]> - 1.0.5-1

0 commit comments

Comments
 (0)