Skip to content

Commit

Permalink
HDDS-3250. Create a separate log file for Warnings and Errors in Mini…
Browse files Browse the repository at this point in the history
…OzoneChaosCluster. (#711)
  • Loading branch information
mukul1987 committed Mar 25, 2020
1 parent 512d607 commit 8249385
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ date=$(date +"%Y-%m-%d-%H-%M-%S-%Z")
logfiledirectory="/tmp/chaos-${date}/"
completesuffix="complete.log"
chaossuffix="chaos.log"
problemsuffix="problem.log"
compilesuffix="compile.log"
heapformat="dump.hprof"

Expand All @@ -30,6 +31,8 @@ chaosfilename="${logfiledirectory}${chaossuffix}"
compilefilename="${logfiledirectory}${compilesuffix}"
#log goes to something like /tmp/2019-12-04--00-01-26-IST/dump.hprof
heapdumpfile="${logfiledirectory}${heapformat}"
#log goes to something like /tmp/2019-12-04--00-01-26-IST/problem.log
problemfilename="${logfiledirectory}${problemsuffix}"

#TODO: add gc log file details as well
MVN_OPTS="-XX:+HeapDumpOnOutOfMemoryError "
Expand All @@ -46,6 +49,7 @@ mvn exec:java \
-Dexec.mainClass="org.apache.hadoop.ozone.TestMiniChaosOzoneCluster" \
-Dexec.classpathScope=test \
-Dchaoslogfilename=${chaosfilename} \
-Dproblemlogfilename=${problemfilename} \
-Dorg.apache.ratis.thirdparty.io.netty.allocator.useCacheForAllThreads=false \
-Dio.netty.leakDetection.level=advanced \
-Dio.netty.leakDetectionLevel=advanced \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# limitations under the License.
# log4j configuration used during build and unit tests

log4j.rootLogger=INFO,stdout
log4j.rootLogger=INFO,stdout,PROBLEM
log4j.threshold=ALL
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
Expand All @@ -29,4 +29,11 @@ log4j.appender.CHAOS.File=${chaoslogfilename}
log4j.appender.CHAOS=org.apache.log4j.FileAppender
log4j.appender.CHAOS.layout=org.apache.log4j.PatternLayout
log4j.appender.CHAOS.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} (%F:%M(%L)) - %m%n

log4j.appender.PROBLEM.File=${problemlogfilename}
log4j.appender.PROBLEM.Threshold=WARN
log4j.appender.PROBLEM=org.apache.log4j.FileAppender
log4j.appender.PROBLEM.layout=org.apache.log4j.PatternLayout
log4j.appender.PROBLEM.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} (%F:%M(%L)) - %m%n

log4j.additivity.org.apache.hadoop.ozone.utils=false

0 comments on commit 8249385

Please sign in to comment.