1# Licensed to the Apache Software Foundation (ASF) under one
2# or more contributor license agreements.  See the NOTICE file
3# distributed with this work for additional information
4# regarding copyright ownership.  The ASF licenses this file
5# to you under the Apache License, Version 2.0 (the
6# "License"); you may not use this file except in compliance
7# with the License.  You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# Define some default values that can be overridden by system properties
18hadoop.root.logger=INFO,console
19hadoop.log.dir=.
20hadoop.log.file=hadoop.log
21
22# Define the root logger to the system property "hadoop.root.logger".
23log4j.rootLogger=${hadoop.root.logger}, EventCounter
24
25# Logging Threshold
26log4j.threshold=ALL
27
28# Null Appender
29log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender
30
31#
32# Rolling File Appender - cap space usage at 5gb.
33#
34hadoop.log.maxfilesize=256MB
35hadoop.log.maxbackupindex=20
36log4j.appender.RFA=org.apache.log4j.RollingFileAppender
37log4j.appender.RFA.File=${hadoop.log.dir}/${hadoop.log.file}
38
39log4j.appender.RFA.MaxFileSize=${hadoop.log.maxfilesize}
40log4j.appender.RFA.MaxBackupIndex=${hadoop.log.maxbackupindex}
41
42log4j.appender.RFA.layout=org.apache.log4j.PatternLayout
43
44# Pattern format: Date LogLevel LoggerName LogMessage
45log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
46# Debugging Pattern format
47#log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
48
49
50#
51# Daily Rolling File Appender
52#
53
54log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
55log4j.appender.DRFA.File=${hadoop.log.dir}/${hadoop.log.file}
56
57# Rollover at midnight
58log4j.appender.DRFA.DatePattern=.yyyy-MM-dd
59
60log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
61
62# Pattern format: Date LogLevel LoggerName LogMessage
63log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
64# Debugging Pattern format
65#log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
66
67
68#
69# console
70# Add "console" to rootlogger above if you want to use this
71#
72
73log4j.appender.console=org.apache.log4j.ConsoleAppender
74log4j.appender.console.target=System.err
75log4j.appender.console.layout=org.apache.log4j.PatternLayout
76log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
77
78#
79# TaskLog Appender
80#
81
82#Default values
83hadoop.tasklog.taskid=null
84hadoop.tasklog.iscleanup=false
85hadoop.tasklog.noKeepSplits=4
86hadoop.tasklog.totalLogFileSize=100
87hadoop.tasklog.purgeLogSplits=true
88hadoop.tasklog.logsRetainHours=12
89
90log4j.appender.TLA=org.apache.hadoop.mapred.TaskLogAppender
91log4j.appender.TLA.taskId=${hadoop.tasklog.taskid}
92log4j.appender.TLA.isCleanup=${hadoop.tasklog.iscleanup}
93log4j.appender.TLA.totalLogFileSize=${hadoop.tasklog.totalLogFileSize}
94
95log4j.appender.TLA.layout=org.apache.log4j.PatternLayout
96log4j.appender.TLA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
97
98#
99# HDFS block state change log from block manager
100#
101# Uncomment the following to suppress normal block state change
102# messages from BlockManager in NameNode.
103#log4j.logger.BlockStateChange=WARN
104
105#
106#Security appender
107#
108hadoop.security.logger=INFO,NullAppender
109hadoop.security.log.maxfilesize=256MB
110hadoop.security.log.maxbackupindex=20
111log4j.category.SecurityLogger=${hadoop.security.logger}
112hadoop.security.log.file=SecurityAuth-${user.name}.audit
113log4j.appender.RFAS=org.apache.log4j.RollingFileAppender
114log4j.appender.RFAS.File=${hadoop.log.dir}/${hadoop.security.log.file}
115log4j.appender.RFAS.layout=org.apache.log4j.PatternLayout
116log4j.appender.RFAS.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
117log4j.appender.RFAS.MaxFileSize=${hadoop.security.log.maxfilesize}
118log4j.appender.RFAS.MaxBackupIndex=${hadoop.security.log.maxbackupindex}
119
120#
121# Daily Rolling Security appender
122#
123log4j.appender.DRFAS=org.apache.log4j.DailyRollingFileAppender
124log4j.appender.DRFAS.File=${hadoop.log.dir}/${hadoop.security.log.file}
125log4j.appender.DRFAS.layout=org.apache.log4j.PatternLayout
126log4j.appender.DRFAS.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
127log4j.appender.DRFAS.DatePattern=.yyyy-MM-dd
128
129#
130# hadoop configuration logging
131#
132
133# Uncomment the following line to turn off configuration deprecation warnings.
134# log4j.logger.org.apache.hadoop.conf.Configuration.deprecation=WARN
135
136#
137# hdfs audit logging
138#
139hdfs.audit.logger=INFO,NullAppender
140hdfs.audit.log.maxfilesize=256MB
141hdfs.audit.log.maxbackupindex=20
142log4j.logger.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=${hdfs.audit.logger}
143log4j.additivity.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=false
144log4j.appender.RFAAUDIT=org.apache.log4j.RollingFileAppender
145log4j.appender.RFAAUDIT.File=${hadoop.log.dir}/hdfs-audit.log
146log4j.appender.RFAAUDIT.layout=org.apache.log4j.PatternLayout
147log4j.appender.RFAAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
148log4j.appender.RFAAUDIT.MaxFileSize=${hdfs.audit.log.maxfilesize}
149log4j.appender.RFAAUDIT.MaxBackupIndex=${hdfs.audit.log.maxbackupindex}
150
151#
152# mapred audit logging
153#
154mapred.audit.logger=INFO,NullAppender
155mapred.audit.log.maxfilesize=256MB
156mapred.audit.log.maxbackupindex=20
157log4j.logger.org.apache.hadoop.mapred.AuditLogger=${mapred.audit.logger}
158log4j.additivity.org.apache.hadoop.mapred.AuditLogger=false
159log4j.appender.MRAUDIT=org.apache.log4j.RollingFileAppender
160log4j.appender.MRAUDIT.File=${hadoop.log.dir}/mapred-audit.log
161log4j.appender.MRAUDIT.layout=org.apache.log4j.PatternLayout
162log4j.appender.MRAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
163log4j.appender.MRAUDIT.MaxFileSize=${mapred.audit.log.maxfilesize}
164log4j.appender.MRAUDIT.MaxBackupIndex=${mapred.audit.log.maxbackupindex}
165
166# Custom Logging levels
167
168#log4j.logger.org.apache.hadoop.mapred.JobTracker=DEBUG
169#log4j.logger.org.apache.hadoop.mapred.TaskTracker=DEBUG
170#log4j.logger.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=DEBUG
171
172# Jets3t library
173log4j.logger.org.jets3t.service.impl.rest.httpclient.RestS3Service=ERROR
174
175# AWS SDK & S3A FileSystem
176log4j.logger.com.amazonaws=ERROR
177log4j.logger.com.amazonaws.http.AmazonHttpClient=ERROR
178log4j.logger.org.apache.hadoop.fs.s3a.S3AFileSystem=WARN
179
180#
181# Event Counter Appender
182# Sends counts of logging messages at different severity levels to Hadoop Metrics.
183#
184log4j.appender.EventCounter=org.apache.hadoop.log.metrics.EventCounter
185
186#
187# Job Summary Appender
188#
189# Use following logger to send summary to separate file defined by
190# hadoop.mapreduce.jobsummary.log.file :
191# hadoop.mapreduce.jobsummary.logger=INFO,JSA
192#
193hadoop.mapreduce.jobsummary.logger=${hadoop.root.logger}
194hadoop.mapreduce.jobsummary.log.file=hadoop-mapreduce.jobsummary.log
195hadoop.mapreduce.jobsummary.log.maxfilesize=256MB
196hadoop.mapreduce.jobsummary.log.maxbackupindex=20
197log4j.appender.JSA=org.apache.log4j.RollingFileAppender
198log4j.appender.JSA.File=${hadoop.log.dir}/${hadoop.mapreduce.jobsummary.log.file}
199log4j.appender.JSA.MaxFileSize=${hadoop.mapreduce.jobsummary.log.maxfilesize}
200log4j.appender.JSA.MaxBackupIndex=${hadoop.mapreduce.jobsummary.log.maxbackupindex}
201log4j.appender.JSA.layout=org.apache.log4j.PatternLayout
202log4j.appender.JSA.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
203log4j.logger.org.apache.hadoop.mapred.JobInProgress$JobSummary=${hadoop.mapreduce.jobsummary.logger}
204log4j.additivity.org.apache.hadoop.mapred.JobInProgress$JobSummary=false
205
206#
207# Yarn ResourceManager Application Summary Log
208#
209# Set the ResourceManager summary log filename
210yarn.server.resourcemanager.appsummary.log.file=rm-appsummary.log
211# Set the ResourceManager summary log level and appender
212yarn.server.resourcemanager.appsummary.logger=${hadoop.root.logger}
213#yarn.server.resourcemanager.appsummary.logger=INFO,RMSUMMARY
214
215# To enable AppSummaryLogging for the RM,
216# set yarn.server.resourcemanager.appsummary.logger to
217# <LEVEL>,RMSUMMARY in hadoop-env.sh
218
219# Appender for ResourceManager Application Summary Log
220# Requires the following properties to be set
221#    - hadoop.log.dir (Hadoop Log directory)
222#    - yarn.server.resourcemanager.appsummary.log.file (resource manager app summary log filename)
223#    - yarn.server.resourcemanager.appsummary.logger (resource manager app summary log level and appender)
224
225log4j.logger.org.apache.hadoop.yarn.server.resourcemanager.RMAppManager$ApplicationSummary=${yarn.server.resourcemanager.appsummary.logger}
226log4j.additivity.org.apache.hadoop.yarn.server.resourcemanager.RMAppManager$ApplicationSummary=false
227log4j.appender.RMSUMMARY=org.apache.log4j.RollingFileAppender
228log4j.appender.RMSUMMARY.File=${hadoop.log.dir}/${yarn.server.resourcemanager.appsummary.log.file}
229log4j.appender.RMSUMMARY.MaxFileSize=256MB
230log4j.appender.RMSUMMARY.MaxBackupIndex=20
231log4j.appender.RMSUMMARY.layout=org.apache.log4j.PatternLayout
232log4j.appender.RMSUMMARY.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
233
234# HS audit log configs
235#mapreduce.hs.audit.logger=INFO,HSAUDIT
236#log4j.logger.org.apache.hadoop.mapreduce.v2.hs.HSAuditLogger=${mapreduce.hs.audit.logger}
237#log4j.additivity.org.apache.hadoop.mapreduce.v2.hs.HSAuditLogger=false
238#log4j.appender.HSAUDIT=org.apache.log4j.DailyRollingFileAppender
239#log4j.appender.HSAUDIT.File=${hadoop.log.dir}/hs-audit.log
240#log4j.appender.HSAUDIT.layout=org.apache.log4j.PatternLayout
241#log4j.appender.HSAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
242#log4j.appender.HSAUDIT.DatePattern=.yyyy-MM-dd
243
244# Http Server Request Logs
245#log4j.logger.http.requests.namenode=INFO,namenoderequestlog
246#log4j.appender.namenoderequestlog=org.apache.hadoop.http.HttpRequestLogAppender
247#log4j.appender.namenoderequestlog.Filename=${hadoop.log.dir}/jetty-namenode-yyyy_mm_dd.log
248#log4j.appender.namenoderequestlog.RetainDays=3
249
250#log4j.logger.http.requests.datanode=INFO,datanoderequestlog
251#log4j.appender.datanoderequestlog=org.apache.hadoop.http.HttpRequestLogAppender
252#log4j.appender.datanoderequestlog.Filename=${hadoop.log.dir}/jetty-datanode-yyyy_mm_dd.log
253#log4j.appender.datanoderequestlog.RetainDays=3
254
255#log4j.logger.http.requests.resourcemanager=INFO,resourcemanagerrequestlog
256#log4j.appender.resourcemanagerrequestlog=org.apache.hadoop.http.HttpRequestLogAppender
257#log4j.appender.resourcemanagerrequestlog.Filename=${hadoop.log.dir}/jetty-resourcemanager-yyyy_mm_dd.log
258#log4j.appender.resourcemanagerrequestlog.RetainDays=3
259
260#log4j.logger.http.requests.jobhistory=INFO,jobhistoryrequestlog
261#log4j.appender.jobhistoryrequestlog=org.apache.hadoop.http.HttpRequestLogAppender
262#log4j.appender.jobhistoryrequestlog.Filename=${hadoop.log.dir}/jetty-jobhistory-yyyy_mm_dd.log
263#log4j.appender.jobhistoryrequestlog.RetainDays=3
264
265#log4j.logger.http.requests.nodemanager=INFO,nodemanagerrequestlog
266#log4j.appender.nodemanagerrequestlog=org.apache.hadoop.http.HttpRequestLogAppender
267#log4j.appender.nodemanagerrequestlog.Filename=${hadoop.log.dir}/jetty-nodemanager-yyyy_mm_dd.log
268#log4j.appender.nodemanagerrequestlog.RetainDays=3
269