Document programmatic HTTPD and SSHD logging configuration

Change-Id: Ie342a593a8ae854fe33f312cac22e1089119614a
This commit is contained in:
David Ostrovsky 2013-11-19 23:57:48 +01:00
parent 1b80031d5e
commit 8e4a99051d
9 changed files with 19 additions and 14 deletions

View File

@ -1725,6 +1725,9 @@ Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
If enabled, an NCSA combined log format request log file is written
out by the internal HTTP daemon.
+
`log4j.appender` with the name `httpd_log` can be configured to overwrite
programmatic configuration.
+
By default, true if httpd.listenUrl uses http:// or https://,
and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
@ -2711,6 +2714,9 @@ By default, `host/canonical.host.name`
Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
If enabled, a request log file is written out by the SSH daemon.
+
`log4j.appender` with the name `sshd_log` can be configured to overwrite
programmatic configuration.
+
By default, true.
[[suggest]] Section suggest

View File

@ -29,13 +29,6 @@ java_library(
visibility = ['PUBLIC'],
)
java_library(
name = 'util',
srcs = glob([SRC + 'util/**/*.java']),
deps = ['//lib:guava'],
visibility = ['PUBLIC'],
)
java_test(
name = 'client_tests',
srcs = glob(['src/test/java/**/*.java']),

View File

@ -88,7 +88,6 @@ java_library2(
':init-base',
'//gerrit-cache-h2:cache-h2',
'//gerrit-common:server',
'//gerrit-common:util',
'//gerrit-extension-api:api',
'//gerrit-gwtexpui:server',
'//gerrit-httpd:httpd',

View File

@ -17,8 +17,8 @@ package com.google.gerrit.pgm.http.jetty;
import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.server.util.LogUtil;
import com.google.gerrit.server.util.TimeUtil;
import com.google.gerrit.util.LogUtil;
import org.apache.log4j.Appender;
import org.apache.log4j.AsyncAppender;
@ -75,6 +75,10 @@ class HttpLog extends AbstractLifeCycle implements RequestLog {
Appender appender = log.getAppender(LOG_NAME);
if (appender != null) {
async.addAppender(appender);
} else {
log.warn("No appender with the name: "
+ LOG_NAME
+ " was found. HTTPD logging is disabled");
}
}
async.activateOptions();

View File

@ -16,7 +16,7 @@ package com.google.gerrit.pgm.util;
import com.google.gerrit.extensions.events.LifecycleListener;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.util.LogUtil;
import com.google.gerrit.server.util.LogUtil;
import org.apache.log4j.Appender;
import org.apache.log4j.ConsoleAppender;

View File

@ -17,7 +17,7 @@ package com.google.gerrit.pgm.util;
import com.google.gerrit.extensions.events.LifecycleListener;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.server.git.GarbageCollection;
import com.google.gerrit.util.LogUtil;
import com.google.gerrit.server.util.LogUtil;
import org.apache.log4j.Appender;
import org.apache.log4j.DailyRollingFileAppender;

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.util;
package com.google.gerrit.server.util;
import com.google.common.base.Strings;

View File

@ -7,7 +7,6 @@ java_library2(
'//gerrit-extension-api:api',
'//gerrit-cache-h2:cache-h2',
'//gerrit-common:server',
'//gerrit-common:util',
'//gerrit-patch-jgit:server',
'//gerrit-reviewdb:server',
'//gerrit-server:server',

View File

@ -25,9 +25,9 @@ import com.google.gerrit.server.PeerDaemonUser;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.server.util.IdGenerator;
import com.google.gerrit.server.util.LogUtil;
import com.google.gerrit.server.util.TimeUtil;
import com.google.gerrit.sshd.SshScope.Context;
import com.google.gerrit.util.LogUtil;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
@ -89,6 +89,10 @@ class SshLog implements LifecycleListener {
Appender appender = log.getAppender(LOG_NAME);
if (appender != null) {
async.addAppender(appender);
} else {
log.warn("No appender with the name: "
+ LOG_NAME
+ " was found. SSHD logging is disabled");
}
}
async.activateOptions();