首页 > 其他分享 >Zookeeper不打印运行日志

Zookeeper不打印运行日志

时间:2023-02-02 14:13:37浏览次数:60  
标签:运行日志 ROLLINGFILE Zookeeper log 打印 appender zookeeper file log4j

 

zookeeper的配置文件目录中缺少log4j.properties文件

# Copyright 2012 The Apache Software Foundation
# 
# 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 properties
zookeeper.root.logger=INFO, CONSOLE

zookeeper.console.threshold=INFO

zookeeper.log.dir=.
zookeeper.log.file=zookeeper.log
zookeeper.log.threshold=INFO
zookeeper.log.maxfilesize=256MB
zookeeper.log.maxbackupindex=20

zookeeper.tracelog.dir=${zookeeper.log.dir}
zookeeper.tracelog.file=zookeeper_trace.log

log4j.rootLogger=${zookeeper.root.logger}

#
# console
# Add "console" to rootlogger above if you want to use this 
#
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n

#
# Add ROLLINGFILE to rootLogger to get log file output
#
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.file}
log4j.appender.ROLLINGFILE.MaxFileSize=${zookeeper.log.maxfilesize}
log4j.appender.ROLLINGFILE.MaxBackupIndex=${zookeeper.log.maxbackupindex}
log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n

#
# Add TRACEFILE to rootLogger to get log file output
#    Log TRACE level and above messages to a log file
#
log4j.appender.TRACEFILE=org.apache.log4j.FileAppender
log4j.appender.TRACEFILE.Threshold=TRACE
log4j.appender.TRACEFILE.File=${zookeeper.tracelog.dir}/${zookeeper.tracelog.file}

log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout
### Notice we are including log4j's NDC here (%x)
log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L][%x] - %m%n

 

标签:运行日志,ROLLINGFILE,Zookeeper,log,打印,appender,zookeeper,file,log4j
From: https://www.cnblogs.com/chuijingjing/p/17085787.html

相关文章

  • Zookeeper算法基础
    第一章算法基础思考:Zookeeper是如何保证数据一致性的?这也是困扰分布式系统框架的一个难题。1.1拜占庭将军问题拜占庭将军问题是一个协议问题,拜占庭帝国军队的将军们......
  • WIN10不显示多台同型号打印机的解决方法
    相比于XP和WIN7简洁的打印机安装逻辑,WIN10的添加打印机过程更麻烦了,而且在WIN10下安装相同型号、名字不同的多台打印机,在“打印机和扫描仪”里只显示一台或两台,更多的打印机......
  • PostgreSQL - raise函数打印字符串
    raise函数在PostgreSQL中,该函数用于打印字符串,类似于Java中的​​System.out.println()​​​,Oracle中的​​dbms_output.put_line()​​。用法如下:raisenotice'Mynamei......
  • 技术汇总:第一章:使用poi实现表单下载成xls文件并打印
    业务需求:点击下载第一种方式:实现代码@RequestMapping("/ad/downExcel")publicStringdownExcel(HttpSessionsession,HttpServletResponseresponse)......
  • Dubbo 中 Zookeeper 注册中心原理分析
    vivo互联网服务器团队-LiWanghong本文通过分析Dubbo中ZooKeeper注册中心的实现ZooKeeperResitry的继承体系结构,自顶向下分析了AbstractRegistry(提供了服务数据的本地......
  • 18-项目实战-日志输出及打印--logging
    转载:https://www.cnblogs.com/wangyingblock/p/10407987.htmlDjango日志输出及打印--loggingDjango使用python自带的logging作为日志打印工具。logging是线程安全的......
  • 基于k8s的zookeeper搭建
    1.官方文档  https://kubernetes.io/zh-cn/docs/tutorials/stateful-application/zookeeper/2.k8s部署2.1.部署文件zookeeper.yamlapiVersion:v1kind:Service......
  • 热敏打印机长文本自动换行打断单词问题记录
    1voidPrinterCtl::writeMyCom(QByteArraydata)2{3intl=0;4for(inti=MaxLength;i<data.size()-1;i+=MaxLength){5if(qAbs(......
  • 【Zookeeper】(一)概述与内部原理
    Zookeeper概述1概述Zookeeper是一个开源的、分布式的,为分布式应用提供协调服务的Apache项目。Zookeeper从设计模式的角度来看,是一个基于观察者模式设计的分布式服......
  • 【Zookeeper】(二)安装与配置
    1安装安装JDK(参考项目部署)将Zookeeper拷贝到Linux下解压tar-zxvfapache-zookeeper-3.5.10-bin.tar.gz-C/opt/module/修改配置文件将/opt/module/ap......