代码之家  ›  专栏  ›  技术社区  ›  Muhammad Gelbana

Logback日志级别更改不起作用

  •  1
  • Muhammad Gelbana  · 技术社区  · 8 年前

    登录。xml

    这是文件,没有动过

    <?xml version="1.0" encoding="UTF-8" ?>
    <!--
     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.
    -->
    <configuration>
      <!--  <appender name="SOCKET"
        class="de.huxhorn.lilith.logback.appender.ClassicMultiplexSocketAppender">
        <Compressing>true</Compressing>
        <ReconnectionDelay>10000</ReconnectionDelay>
        <IncludeCallerData>true</IncludeCallerData>
        <RemoteHosts>${LILITH_HOSTNAME:-localhost}</RemoteHosts>
      </appender>
       -->
    
      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
          <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
          </pattern>
        </encoder>
      </appender>
    
        <appender name="QUERY" class="ch.qos.logback.core.rolling.RollingFileAppender">
          <file>${log.query.path}</file>
          <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>${log.query.path}.%i</fileNamePattern>
            <minIndex>1</minIndex>
            <maxIndex>10</maxIndex>
          </rollingPolicy>
    
          <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>100MB</maxFileSize>
          </triggeringPolicy>
          <encoder>
            <pattern>%msg%n</pattern>
          </encoder>
        </appender>
    
    
        <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
          <file>${log.path}</file>
          <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>${log.path}.%i</fileNamePattern>
            <minIndex>1</minIndex>
            <maxIndex>10</maxIndex>
          </rollingPolicy>
    
          <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>100MB</maxFileSize>
          </triggeringPolicy>
          <encoder>
            <pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern>
          </encoder>
        </appender>
    
    
      <logger name="org.apache.drill" additivity="false">
        <level value="info" />
        <appender-ref ref="FILE" />
      </logger>
    
      <logger name="query.logger" additivity="false">
        <level value="info" />
        <appender-ref ref="QUERY" />
        <!--     <appender-ref ref="SOCKET" /> -->
      </logger>
    
      <!-- 
      <logger name="org.apache.drill" additivity="false">
        <level value="debug" />
        <appender-ref ref="SOCKET" />
      </logger>
       -->
    
      <root>
        <level value="error" />
        <appender-ref ref="STDOUT" />
      </root>
    
    </configuration>
    

    之后我所做的就是编辑

    <logger name="org.apache.drill" additivity="false">
      <level value="info" />
      <appender-ref ref="FILE" />
    </logger>
    

    <logger name="org.apache.drill" additivity="false">
      <level value="debug" />
      <appender-ref ref="FILE" />
    </logger>
    

    这是用于启动应用程序的java命令(搜索 -cp /home/gelbana/drillv11/conf ,logback。xml文件位于 目录)

    /usr/java/jdk1.8.0_112/bin/java -Xms10G -Xmx10G -XX:MaxDirectMemorySize=230G -XX:ReservedCodeCacheSize=1G -Ddrill.exec.enable-epoll=false -XX:MaxPermSize=512M -Djava.io.tmpdir=/home/gelbana/drillv11/tmp -Ddrill.memory.debug.allocator=true -XX:+CMSClassUnloadingEnabled -XX:+UseG1GC -Dlog.path=/home/gelbana/drillv11/log/drillbit.log -Dlog.query.path=/home/gelbana/drillv11/log/drillbit_queries.json -cp /home/gelbana/drillv11/conf:/home/gelbana/drillv11/jars/*:/home/gelbana/drillv11/jars/ext/*:/home/gelbana/drillv11/jars/3rdparty/*:/home/gelbana/drillv11/jars/classb/* org.apache.drill.exec.server.Drillbit
    

    钻头。文件开头有以下几行

    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/home/gelbana/drillv11/jars/3rdparty/slf4j-simple-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/home/gelbana/drillv11/jars/classb/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
    SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
    

    我尝试将所有级别更改为 调试 全部 但仍然没有什么变化。我找不到一个 DBEUG公司

    1 回复  |  直到 8 年前
        1
  •  1
  •   Community Mohan Dere    5 年前

    您所做的更改 应该

    调试o.a.drill。执行董事。服务器StartupOptions-解析参数。

    drillbit.out LoggerContext 例如:

    在以下位置找到资源[logback.xml]。。。

    资源[logback.xml]在类路径上出现多次

    你可能会发现,Logback通过它自己的日志来重新显示答案。

    推荐文章