Skip to content

Commit

Permalink
fix: enforce ISO8601 standard on log timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
giem-git committed Sep 26, 2023
1 parent daf1019 commit 73cad4d
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion tdp_vars_defaults/hadoop/hadoop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ hadoop_root_logger_level: INFO
hadoop_log_file: hadoop.log
hadoop_env_client_log_dir: /var/log/hadoop/$USER
hadoop_log4j_client_log_dir: .
hadoop_log_layout_pattern: "%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n"
hadoop_log_layout_pattern: "{{ tdp_default_log_layout_pattern }}"
# DRFA appenders config
hadoop_log_drfa_date_pattern: "'.'yyyy-MM-dd"
# RFA appenders config
Expand Down
4 changes: 2 additions & 2 deletions tdp_vars_defaults/hbase/hbase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ hbase_root_logger_level: INFO
# Root logger should be: [RFA | DRFA]
hbase_root_logger: RFA
# Common appenders config
hbase_log_layout_pattern: "%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n"
hbase_log_layout_pattern: "{{ tdp_default_log_layout_pattern }}"
# DRFA appenders config
hbase_log_drfa_date_pattern: "'.'yyyy-MM-dd"
# RFA appenders config
Expand Down Expand Up @@ -211,7 +211,7 @@ phoenix_root_logger_level: INFO
# Root logger should be: [RFA | DRFA]
phoenix_root_logger: RFA
# Common appenders config
phoenix_log_layout_pattern: "%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n"
phoenix_log_layout_pattern: "{{ tdp_default_log_layout_pattern }}"
# DRFA appenders config
phoenix_log_drfa_date_pattern: "'.'yyyy-MM-dd"
# RFA appenders config
Expand Down
2 changes: 1 addition & 1 deletion tdp_vars_defaults/hive/hive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ hive_root_logger: RFA
# Root logger level should be: [FATAL| ERROR| WARN| INFO| DEBUG| TRACE]
hive_root_logger_level: INFO
# Common appenders config
hive_log_layout_pattern: "%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n"
hive_log_layout_pattern: "{{ tdp_default_log_layout_pattern }}"
# RFA appender config
hive_log_rfa_maxfilesize: 256MB
hive_log_rfa_maxbackupindex: 10
Expand Down
2 changes: 1 addition & 1 deletion tdp_vars_defaults/knox/knox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ knox_root_logger_level: INFO
knox_root_logger: RFA
# Common appenders config

knox_log_layout_pattern: "%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n"
knox_log_layout_pattern: "{{ tdp_default_log_layout_pattern }}"
# DRFA appenders config
knox_log_drfa_date_pattern: "'.'yyyy-MM-dd"
# RFA appenders config
Expand Down
2 changes: 1 addition & 1 deletion tdp_vars_defaults/ranger/ranger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ranger_root_logger: RFA
# Root logger level should be: [FATAL| ERROR| WARN| INFO| DEBUG| TRACE]
ranger_root_logger_level: INFO
# Common appenders config
ranger_log_layout_pattern: "%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n"
ranger_log_layout_pattern: "{{ tdp_default_log_layout_pattern }}"
# DRFA appenders config
ranger_log_drfa_date_pattern: "'.'yyyy-MM-dd-HH-mm"
ranger_solr_log_drfa_date_pattern: "%d{yyyy-MM-dd-HH-mm}"
Expand Down
2 changes: 1 addition & 1 deletion tdp_vars_defaults/spark/spark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spark_root_logger_level: INFO
# Common appenders config
spark_log_dir: "{{ spark2_log_dir }}"
spark_hs_log_file: "{{ spark2_hs_log_file }}"
spark_log_layout_pattern: "%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n"
spark_log_layout_pattern: "{{ tdp_default_log_layout_pattern }}"
# DRFA appenders config
spark_log_drfa_date_pattern: "'.'yyyy-MM-dd-HH-mm"
# RFA appenders config
Expand Down
2 changes: 1 addition & 1 deletion tdp_vars_defaults/spark3/spark3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spark_root_logger_level: INFO
# Common appenders config
spark_log_dir: "{{ spark3_log_dir }}"
spark_hs_log_file: "{{ spark3_hs_log_file }}"
spark_log_layout_pattern: "%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n"
spark_log_layout_pattern: "{{ tdp_default_log_layout_pattern }}"
# DRFA appenders config
spark_log_drfa_date_pattern: "'.'yyyy-MM-dd-HH-mm"
# RFA appenders config
Expand Down
43 changes: 24 additions & 19 deletions tdp_vars_defaults/tdp-cluster/tdp-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,45 +164,50 @@ exporter_hdfs_httpfs_http_port: 18122
#################################
# Service & Component logs dirs #
#################################
# format : log4j 1.x "%d{ISO8601}" is not fully compliant with ISO8601 standard
# (no 'T' as date/time separator) we specify it here.
tdp_date_iso8601_with_tz: "%d{yyyy-MM-dd'T'hh:mm:ss.SSSXXX}"
tdp_default_log_layout_pattern: '{{ tdp_date_iso8601_with_tz }} - %-5p [%t:%C{1}@%L] - %m%n'

hadoop_log_dir: /var/log/hadoop

hdfs_log_dir: /var/log/hdfs
hadoop_hdfs_namenode_log_file: "hdfs-namenode_${HOSTNAME}.log"
hadoop_hdfs_journalnode_log_file: "hdfs-journalnode_${HOSTNAME}.log"
hadoop_hdfs_zkfc_log_file: "hdfs-zkfc_${HOSTNAME}.log"
hadoop_hdfs_datanode_log_file: "hdfs-datanode_${HOSTNAME}.log"
hadoop_hdfs_httpfs_log_file: "hdfs-httpfs_${HOSTNAME}.log"
hadoop_hdfs_namenode_log_file: "hdfs-namenode_{{ ansible_fqdn }}.log"
hadoop_hdfs_journalnode_log_file: "hdfs-journalnode_{{ ansible_fqdn }}.log"
hadoop_hdfs_zkfc_log_file: "hdfs-zkfc_{{ ansible_fqdn }}.log"
hadoop_hdfs_datanode_log_file: "hdfs-datanode_{{ ansible_fqdn }}.log"
hadoop_hdfs_httpfs_log_file: "hdfs-httpfs_{{ ansible_fqdn }}.log"

yarn_log_dir: /var/log/yarn
hadoop_yarn_resourcemanager_log_file: "yarn-resourcemanager_${HOSTNAME}.log"
hadoop_yarn_nodemanager_log_file: "yarn-nodemanager_${HOSTNAME}.log"
hadoop_yarn_timelineserver_log_file: "yarn-timelineserver_${HOSTNAME}.log"
hadoop_yarn_resourcemanager_log_file: "yarn-resourcemanager_{{ ansible_fqdn }}.log"
hadoop_yarn_nodemanager_log_file: "yarn-nodemanager_{{ ansible_fqdn }}.log"
hadoop_yarn_timelineserver_log_file: "yarn-timelineserver_{{ ansible_fqdn }}.log"

mapred_log_dir: /var/log/mapred
hadoop_mapred_historyserver_log_file: "mapred-historyserver_${HOSTNAME}.log"
hadoop_mapred_historyserver_log_file: "mapred-historyserver_{{ ansible_fqdn }}.log"

hbase_log_dir: /var/log/hbase
hbase_hm_log_file: "hbase-master_${HOSTNAME}.log"
hbase_hrs_log_file: "hbase-regionserver_${HOSTNAME}.log"
hbase_hr_log_file: "hbase-rest_${HOSTNAME}.log"
hbase_hm_log_file: "hbase-master_{{ ansible_fqdn }}.log"
hbase_hrs_log_file: "hbase-regionserver_{{ ansible_fqdn }}.log"
hbase_hr_log_file: "hbase-rest_{{ ansible_fqdn }}.log"

phoenix_log_dir: /var/log/phoenix
phoenix_queryserver_log_file: "phoenix-queryserver_${HOSTNAME}.log"
phoenix_queryserver_log_file: "phoenix-queryserver_{{ ansible_fqdn }}.log"

hive_log_dir: /var/log/hive
hive_s2_log_file: "hive-hiveserver2_${HOSTNAME}.log"
hive_ms_log_file: "hive-metastore_${HOSTNAME}.log"
hive_s2_log_file: "hive-hiveserver2_{{ ansible_fqdn }}.log"
hive_ms_log_file: "hive-metastore_{{ ansible_fqdn }}.log"

knox_log_dir: /var/log/knox
knox_gateway_log_file: "knox-gateway_${HOSTNAME}.log"
knox_gateway_log_file: "knox-gateway_{{ ansible_fqdn }}.log"

ranger_log_dir: /var/log/ranger
ranger_admin_log_file: "ranger-admin_${HOSTNAME}.log"
ranger_usersync_log_file: "ranger-usersync_${HOSTNAME}.log"
ranger_admin_log_file: "ranger-admin_{{ ansible_fqdn }}.log"
ranger_usersync_log_file: "ranger-usersync_{{ ansible_fqdn }}.log"
ranger_solr_log_file: "ranger-solr_{{ ansible_fqdn }}.log"

ranger_kms_log_dir: /var/log/kms
ranger_kms_log_file: "ranger-kms_${HOSTNAME}.log"
ranger_kms_log_file: "ranger-kms_{{ ansible_fqdn }}.log"

spark2_log_dir: /var/log/spark
spark2_hs_log_file: "spark-historyserver_{{ ansible_fqdn }}.log"
Expand Down
2 changes: 1 addition & 1 deletion tdp_vars_defaults/zookeeper/zookeeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ zookeeper_root_logger_level: INFO
# Root logger should be: [RFA | DRFA]
zookeeper_root_logger: RFA
# Common appenders config
zookeeper_log_layout_pattern: "%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n"
zookeeper_log_layout_pattern: "{{ tdp_default_log_layout_pattern }}"
# DRFA appenders config
zookeeper_log_drfa_date_pattern: "'.'yyyy-MM-dd"
# RFA appenders config
Expand Down

0 comments on commit 73cad4d

Please sign in to comment.