Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Bug 1163068 Bug 1163910 - Watchman Updates #5957

Merged
merged 2 commits into from
Nov 13, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions node-util/conf/sysconfig/watchman
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@

# Watchman debug - prints debug messages like memory usage
#WATCHMAN_DEBUG=true

# Watchman event logging configuration
#LOG_FILE=/var/log/openshift/node/watchman.log
#LOG_LEVEL=INFO
#TRACE_LOG_FILE=/var/log/openshift/node/watchman-trace.log
#TRACE_LOG_LEVEL=ERROR
42 changes: 37 additions & 5 deletions node-util/man8/oo-watchman.8
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,37 @@ Default: 5 seconds
Wait at least this number of seconds since last check before looking for gears under OOM.
Default: 0 seconds
.TP
.B FRONTEND_CLEANUP_PERIOD
Wait at least this number of seconds since last check before cleaning up frontend http configuration files.
Default: 172800 seconds
.TP
.B LOG_FILE
General events logged to this file.
May be overridden with WATCHMAN_LOG_FILE in node.conf file.
Default: /var/log/openshift/node/watchman.log
.TP
.B LOG_LEVEL
Set level of logging.
May be overridden with WATCHMAN_LOG_LEVEL in node.conf file.
Valid values: DEBUG (most verbose), INFO, WARN, ERROR, FATAL (least verbose)
Default: INFO
.TP
.B
TRACE_LOG
Trace events logged to this file.
May be overridden with WATCHMAN_TRACE_LOG_FILE in node.conf file.
Default: /var/log/openshift/node/watchman-trace.log
.TP
.B
TRACE_LOG_LEVEL
Set trace level of logging.
May be overridden with WATCHMAN_TRACE_LOG_LEVEL in node.conf file.
Valid values: DEBUG (most verbose), INFO, WARN, ERROR, FATAL (least verbose)
Default: ERROR
.TP
.TP
.B WATCHMAN_DEBUG
Boolean value to suggest printing debug messages in log.
Boolean value to suggest printing debug messages in log.
e.g. printing memory usage after invocation of each plugin (logged in /var/log/messages)
Default: false
.SH FILES
Expand All @@ -71,13 +100,13 @@ Node configuration elements
Directory containing Watchman plugins. Location may be overridden in node.conf using by setting the
.B
WATCHMAN_PLUGIN_DIR
element
element. Only scripts ending in \fB.rb\fR are read.
.TP
.FN /var/log/watchman.log
Exceptions from oo-watchman are logged here
Exceptions from openshift-watchman and oo-watchman are logged here
.TP
.FN /var/log/watchman.output
STDOUT and STDERR from watchman and plugins are logged here
STDOUT and STDERR from openshift-watchman are logged here
.TP
.FN /var/log/messages
Watchman initiated changes in gear state or status is logged
Expand All @@ -94,5 +123,8 @@ the last state change for the application commanded by the user. It will restart
that have failed, or stop applications that are still running.
.P
The \fBThrottlerPlugin\fR monitors CPU usage via cgroups and restricts usage, if needed.

.P
The \fBFronendPlugin\fR monitors the frontend httpd proxy configuration files and removes configuration
files that have been truncated.
Truncation is used to provide a cleaner starting/stopping of httpd.
.SH SEE ALSO
22 changes: 14 additions & 8 deletions node-util/sbin/oo-watchman
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,24 @@ module OpenShift
# @param [Config] config elements from node.conf
# @return [NodeLogger] Properly configured NodeLogger for Watchman to use
def logger(config)
logfile = ENV['LOG_FILE'] || '/var/log/openshift/node/watchman.log'
loglevel = ENV['LOG_LEVEL'] ? Logger::Severity.const_get(ENV['LOG_LEVEL'].upcase) : Logger::INFO

trace_logfile = ENV['TRACE_LOG_FILE'] || '/var/log/openshift/node/watchman-trace.log'
trace_loglevel = ENV['TRACE_LOG_LEVEL'] ? Logger::Severity.const_get(ENV['TRACE_LOG_LEVEL'].upcase) : Logger::ERROR

logger_profiles = {
standard: {
file_config: 'WATCHMAN_CGROUPS_LOG_FILE',
level_config: 'WATCHMAN_CGROUPS_LOG_LEVEL',
default_file: PathUtils.join(File::SEPARATOR, %w{var log openshift node cgroups.log}),
default_level: Logger::INFO
file_config: 'WATCHMAN_LOG_FILE',
level_config: 'WATCHMAN_LOG_LEVEL',
default_file: logfile,
default_level: loglevel
},
trace: {
file_config: 'WATCHMAN_CGROUPS_TRACE_LOG_FILE',
level_config: 'WATCHMAN_CGROUPS_TRACE_LOG_LEVEL',
default_file: PathUtils.join(File::SEPARATOR, %w{var log openshift node cgroups-trace.log}),
default_level: Logger::ERROR
file_config: 'WATCHMAN_TRACE_LOG_FILE',
level_config: 'WATCHMAN_TRACE_LOG_LEVEL',
default_file: trace_logfile,
default_level: trace_loglevel
}
}

Expand Down
2 changes: 1 addition & 1 deletion node/misc/etc/openshift-origin-node.logrotate.service
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/var/log/openshift/node/cgroups*.log {
/var/log/openshift/node/watchman*.log {
copytruncate
rotate 30
daily
Expand Down
2 changes: 1 addition & 1 deletion node/misc/etc/openshift-origin-node.logrotate.systemd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/var/log/openshift/node/cgroups*.log {
/var/log/openshift/node/watchman*.log {
copytruncate
rotate 30
daily
Expand Down