Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-2916 Fix log file rotation / rename default log file (#714)

Sebastian Nageldc6e320fbdea
diff --git a/conf/log4j2.xml b/conf/log4j2.xml
index 80203be0a..9eb807b4f 100644
--- a/conf/log4j2.xml
+++ b/conf/log4j2.xml
@@ -21,13 +21,12 @@
NUTCH_LOG_DIR and NUTCH_LOGFILE -->
<Property name="hadoop.log.dir">${sys:hadoop.log.dir:-./logs}</Property>
<Property name="hadoop.log.file">${sys:hadoop.log.file:-hadoop.log}</Property>
- <Property name="hadoop.log.file">hadoop.log</Property>
</Properties>
<Appenders>
<RollingFile name="RollingFile" fileName="${hadoop.log.dir}/${hadoop.log.file}"
filePattern="${hadoop.log.dir}/$${date:yyyy-MM}/nutch-%d{yyyy-MM-dd}.log.gz">
<PatternLayout pattern="%d %p %c{1.} [%t] %m%n" />
- <CronTriggeringPolicy schedule="0 0 0 * * ?"/>
+ <CronTriggeringPolicy schedule="0 0 0 * * ?" evaluateOnStartup="true" />
<DefaultRolloverStrategy>
<Delete basePath="${hadoop.log.dir}" maxDepth="2">
<IfFileName glob="*/nutch-*.log.gz" />
diff --git a/src/bin/nutch b/src/bin/nutch
index 3563b45f6..7b90dbe26 100755
--- a/src/bin/nutch
+++ b/src/bin/nutch
@@ -29,7 +29,8 @@
#
# NUTCH_LOG_DIR Log directory (default: $NUTCH_HOME/logs)
#
-# NUTCH_LOGFILE Log file (default: hadoop.log)
+# NUTCH_LOGFILE Log file (default: nutch.log - if overridden, do not forget
+# to change the log file rotation patterns in conf/log4j2.xml)
#
# NUTCH_CONF_DIR Path(s) to configuration files (default: $NUTCH_HOME/conf).
# Multiple paths must be separated by a colon ':'.