欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

pom.xml的小tips

时间:2023-07-22

Idea的注意事项

log4j.properties的位置

如果没有log4j.properties,那就手动创建一个

# Licensed to the Apache Software Foundation (ASF) under one# or more contributor license agreements、 See the NOTICE file# distributed with this work for additional information# regarding copyright ownership、 The ASF licenses this file# to you under the Apache License, Version 2.0 (the# "License"); you may not use this file except in compliance# with the License、 You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR ConDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.# Define some default values that can be overridden by system propertieshadoop.root.logger=INFO,consolehadoop.log.dir=.hadoop.log.file=hadoop.log# Define the root logger to the system property "hadoop.root.logger".log4j.rootLogger=${hadoop.root.logger}, EventCounter# Logging Thresholdlog4j.threshold=ALL# Null Appenderlog4j.appender.NullAppender=org.apache.log4j.varia.NullAppender## Rolling File Appender - cap space usage at 5gb.#hadoop.log.maxfilesize=256MBhadoop.log.maxbackupindex=20log4j.appender.RFA=org.apache.log4j.RollingFileAppenderlog4j.appender.RFA.File=${hadoop.log.dir}/${hadoop.log.file}log4j.appender.RFA.MaxFileSize=${hadoop.log.maxfilesize}log4j.appender.RFA.MaxBackupIndex=${hadoop.log.maxbackupindex}log4j.appender.RFA.layout=org.apache.log4j.PatternLayout# Pattern format: Date LogLevel LoggerName LogMessagelog4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n# Debugging Pattern format#log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n## Daily Rolling File Appender#log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.DRFA.File=${hadoop.log.dir}/${hadoop.log.file}# Rollover at midnightlog4j.appender.DRFA.DatePattern=.yyyy-MM-ddlog4j.appender.DRFA.layout=org.apache.log4j.PatternLayout# Pattern format: Date LogLevel LoggerName LogMessagelog4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n# Debugging Pattern format#log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n## console# Add "console" to rootlogger above if you want to use this #log4j.appender.console=org.apache.log4j.ConsoleAppenderlog4j.appender.console.target=System.errlog4j.appender.console.layout=org.apache.log4j.PatternLayoutlog4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n## TaskLog Appender##Default valueshadoop.tasklog.taskid=nullhadoop.tasklog.iscleanup=falsehadoop.tasklog.noKeepSplits=4hadoop.tasklog.totalLogFileSize=100hadoop.tasklog.purgeLogSplits=truehadoop.tasklog.logsRetainHours=12log4j.appender.TLA=org.apache.hadoop.mapred.TaskLogAppenderlog4j.appender.TLA.taskId=${hadoop.tasklog.taskid}log4j.appender.TLA.isCleanup=${hadoop.tasklog.iscleanup}log4j.appender.TLA.totalLogFileSize=${hadoop.tasklog.totalLogFileSize}log4j.appender.TLA.layout=org.apache.log4j.PatternLayoutlog4j.appender.TLA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n## HDFS block state change log from block manager## Uncomment the following to suppress normal block state change# messages from BlockManager in NameNode.#log4j.logger.BlockStateChange=WARN##Security appender#hadoop.security.logger=INFO,NullAppenderhadoop.security.log.maxfilesize=256MBhadoop.security.log.maxbackupindex=20log4j.category.SecurityLogger=${hadoop.security.logger}hadoop.security.log.file=SecurityAuth-${user.name}.auditlog4j.appender.RFAS=org.apache.log4j.RollingFileAppender log4j.appender.RFAS.File=${hadoop.log.dir}/${hadoop.security.log.file}log4j.appender.RFAS.layout=org.apache.log4j.PatternLayoutlog4j.appender.RFAS.layout.ConversionPattern=%d{ISO8601} %p %c: %m%nlog4j.appender.RFAS.MaxFileSize=${hadoop.security.log.maxfilesize}log4j.appender.RFAS.MaxBackupIndex=${hadoop.security.log.maxbackupindex}## Daily Rolling Security appender#log4j.appender.DRFAS=org.apache.log4j.DailyRollingFileAppender log4j.appender.DRFAS.File=${hadoop.log.dir}/${hadoop.security.log.file}log4j.appender.DRFAS.layout=org.apache.log4j.PatternLayoutlog4j.appender.DRFAS.layout.ConversionPattern=%d{ISO8601} %p %c: %m%nlog4j.appender.DRFAS.DatePattern=.yyyy-MM-dd## hadoop configuration logging## Uncomment the following line to turn off configuration deprecation warnings.# log4j.logger.org.apache.hadoop.conf.Configuration.deprecation=WARN## hdfs audit logging#hdfs.audit.logger=INFO,NullAppenderhdfs.audit.log.maxfilesize=256MBhdfs.audit.log.maxbackupindex=20log4j.logger.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=${hdfs.audit.logger}log4j.additivity.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=falselog4j.appender.RFAAUDIT=org.apache.log4j.RollingFileAppenderlog4j.appender.RFAAUDIT.File=${hadoop.log.dir}/hdfs-audit.loglog4j.appender.RFAAUDIT.layout=org.apache.log4j.PatternLayoutlog4j.appender.RFAAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%nlog4j.appender.RFAAUDIT.MaxFileSize=${hdfs.audit.log.maxfilesize}log4j.appender.RFAAUDIT.MaxBackupIndex=${hdfs.audit.log.maxbackupindex}## mapred audit logging#mapred.audit.logger=INFO,NullAppendermapred.audit.log.maxfilesize=256MBmapred.audit.log.maxbackupindex=20log4j.logger.org.apache.hadoop.mapred.AuditLogger=${mapred.audit.logger}log4j.additivity.org.apache.hadoop.mapred.AuditLogger=falselog4j.appender.MRAUDIT=org.apache.log4j.RollingFileAppenderlog4j.appender.MRAUDIT.File=${hadoop.log.dir}/mapred-audit.loglog4j.appender.MRAUDIT.layout=org.apache.log4j.PatternLayoutlog4j.appender.MRAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%nlog4j.appender.MRAUDIT.MaxFileSize=${mapred.audit.log.maxfilesize}log4j.appender.MRAUDIT.MaxBackupIndex=${mapred.audit.log.maxbackupindex}# Custom Logging levels#log4j.logger.org.apache.hadoop.mapred.JobTracker=DEBUG#log4j.logger.org.apache.hadoop.mapred.TaskTracker=DEBUG#log4j.logger.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=DEBUG# Jets3t librarylog4j.logger.org.jets3t.service.impl.rest.httpclient.RestS3Service=ERROR# AWS SDK & S3A FileSystemlog4j.logger.com.amazonaws=ERRORlog4j.logger.com.amazonaws.http.AmazonHttpClient=ERRORlog4j.logger.org.apache.hadoop.fs.s3a.S3AFileSystem=WARN## Event Counter Appender# Sends counts of logging messages at different severity levels to Hadoop Metrics.#log4j.appender.EventCounter=org.apache.hadoop.log.metrics.EventCounter## Job Summary Appender ## Use following logger to send summary to separate file defined by # hadoop.mapreduce.jobsummary.log.file :# hadoop.mapreduce.jobsummary.logger=INFO,JSA# hadoop.mapreduce.jobsummary.logger=${hadoop.root.logger}hadoop.mapreduce.jobsummary.log.file=hadoop-mapreduce.jobsummary.loghadoop.mapreduce.jobsummary.log.maxfilesize=256MBhadoop.mapreduce.jobsummary.log.maxbackupindex=20log4j.appender.JSA=org.apache.log4j.RollingFileAppenderlog4j.appender.JSA.File=${hadoop.log.dir}/${hadoop.mapreduce.jobsummary.log.file}log4j.appender.JSA.MaxFileSize=${hadoop.mapreduce.jobsummary.log.maxfilesize}log4j.appender.JSA.MaxBackupIndex=${hadoop.mapreduce.jobsummary.log.maxbackupindex}log4j.appender.JSA.layout=org.apache.log4j.PatternLayoutlog4j.appender.JSA.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%nlog4j.logger.org.apache.hadoop.mapred.JobInProgress$JobSummary=${hadoop.mapreduce.jobsummary.logger}log4j.additivity.org.apache.hadoop.mapred.JobInProgress$JobSummary=false## Yarn ResourceManager Application Summary Log ## Set the ResourceManager summary log filenameyarn.server.resourcemanager.appsummary.log.file=rm-appsummary.log# Set the ResourceManager summary log level and appenderyarn.server.resourcemanager.appsummary.logger=${hadoop.root.logger}#yarn.server.resourcemanager.appsummary.logger=INFO,RMSUMMARY# To enable AppSummaryLogging for the RM, # set yarn.server.resourcemanager.appsummary.logger to # ,RMSUMMARY in hadoop-env.sh# Appender for ResourceManager Application Summary Log# Requires the following properties to be set# - hadoop.log.dir (Hadoop Log directory)# - yarn.server.resourcemanager.appsummary.log.file (resource manager app summary log filename)# - yarn.server.resourcemanager.appsummary.logger (resource manager app summary log level and appender)log4j.logger.org.apache.hadoop.yarn.server.resourcemanager.RMAppManager$ApplicationSummary=${yarn.server.resourcemanager.appsummary.logger}log4j.additivity.org.apache.hadoop.yarn.server.resourcemanager.RMAppManager$ApplicationSummary=falselog4j.appender.RMSUMMARY=org.apache.log4j.RollingFileAppenderlog4j.appender.RMSUMMARY.File=${hadoop.log.dir}/${yarn.server.resourcemanager.appsummary.log.file}log4j.appender.RMSUMMARY.MaxFileSize=256MBlog4j.appender.RMSUMMARY.MaxBackupIndex=20log4j.appender.RMSUMMARY.layout=org.apache.log4j.PatternLayoutlog4j.appender.RMSUMMARY.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n# HS audit log configs#mapreduce.hs.audit.logger=INFO,HSAUDIT#log4j.logger.org.apache.hadoop.mapreduce.v2.hs.HSAuditLogger=${mapreduce.hs.audit.logger}#log4j.additivity.org.apache.hadoop.mapreduce.v2.hs.HSAuditLogger=false#log4j.appender.HSAUDIT=org.apache.log4j.DailyRollingFileAppender#log4j.appender.HSAUDIT.File=${hadoop.log.dir}/hs-audit.log#log4j.appender.HSAUDIT.layout=org.apache.log4j.PatternLayout#log4j.appender.HSAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n#log4j.appender.HSAUDIT.DatePattern=.yyyy-MM-dd# Http Server Request Logs#log4j.logger.http.requests.namenode=INFO,namenoderequestlog#log4j.appender.namenoderequestlog=org.apache.hadoop.http.HttpRequestLogAppender#log4j.appender.namenoderequestlog.Filename=${hadoop.log.dir}/jetty-namenode-yyyy_mm_dd.log#log4j.appender.namenoderequestlog.RetainDays=3#log4j.logger.http.requests.datanode=INFO,datanoderequestlog#log4j.appender.datanoderequestlog=org.apache.hadoop.http.HttpRequestLogAppender#log4j.appender.datanoderequestlog.Filename=${hadoop.log.dir}/jetty-datanode-yyyy_mm_dd.log#log4j.appender.datanoderequestlog.RetainDays=3#log4j.logger.http.requests.resourcemanager=INFO,resourcemanagerrequestlog#log4j.appender.resourcemanagerrequestlog=org.apache.hadoop.http.HttpRequestLogAppender#log4j.appender.resourcemanagerrequestlog.Filename=${hadoop.log.dir}/jetty-resourcemanager-yyyy_mm_dd.log#log4j.appender.resourcemanagerrequestlog.RetainDays=3#log4j.logger.http.requests.jobhistory=INFO,jobhistoryrequestlog#log4j.appender.jobhistoryrequestlog=org.apache.hadoop.http.HttpRequestLogAppender#log4j.appender.jobhistoryrequestlog.Filename=${hadoop.log.dir}/jetty-jobhistory-yyyy_mm_dd.log#log4j.appender.jobhistoryrequestlog.RetainDays=3#log4j.logger.http.requests.nodemanager=INFO,nodemanagerrequestlog#log4j.appender.nodemanagerrequestlog=org.apache.hadoop.http.HttpRequestLogAppender#log4j.appender.nodemanagerrequestlog.Filename=${hadoop.log.dir}/jetty-nodemanager-yyyy_mm_dd.log#log4j.appender.nodemanagerrequestlog.RetainDays=3# WebHdfs request log on datanodes# Specify -Ddatanode.webhdfs.logger=INFO,HTTPDRFA on datanode startup to# direct the log to a separate file.#datanode.webhdfs.logger=INFO,console#log4j.logger.datanode.webhdfs=${datanode.webhdfs.logger}#log4j.appender.HTTPDRFA=org.apache.log4j.DailyRollingFileAppender#log4j.appender.HTTPDRFA.File=${hadoop.log.dir}/hadoop-datanode-webhdfs.log#log4j.appender.HTTPDRFA.layout=org.apache.log4j.PatternLayout#log4j.appender.HTTPDRFA.layout.ConversionPattern=%d{ISO8601} %m%n#log4j.appender.HTTPDRFA.DatePattern=.yyyy-MM-dd

在project中的src->main->resource文件夹里面

注意:

只有project是之前搞过maven的情况下才会生成pom.xml,默认情况的idea只有一个iml文件

正文阶段:

mapreduce时期的pom.xml插件

org.apache.hadoop hadoop-common 2.7.6 org.apache.hadoop hadoop-client 2.7.6 org.apache.hadoop hadoop-hdfs 2.7.6

存放位置

hbase时期

org.apache.hadoop hadoop-common 2.7.6 org.apache.hadoop hadoop-client 2.7.6 org.apache.hadoop hadoop-hdfs 2.7.6

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。