简体   繁体   中英

How to set log level in chronos

I'm trying to change the loglevel in chronos from the default INFO to TRACE . I have gone through the docs and they seem to be outdated as per this issue.

I have done a local setup using docker but to no avail

docker-compose.yaml

version: '3'
services:
  zk1:
    image: zookeeper
    restart: always
    ports:
      - "2181:2181"
    environment:
      ZOO_MY_ID: 1
      ZOO_SERVERS: server.1=zk1:2888:3888

  chronos:
    image: docker.io/mesosphere/chronos:chronos-2.5.1-0.1.20171211074431.ubuntu1404-mesos-1.3.1
    command: /usr/bin/chronos run_jar --http_port 4400 --master zk://zk1:2181/mesos --zk_hosts zk://zk1:2181/mesos
    ports:
      - "4400:4400"
    environment:
      "JVM_OPTS": "-Dlogback.configurationFile=/tmp/logback.xml"
    volumes:
      - ./logback.xml:/tmp/logback.xml
    depends_on:
      - zk1

lockback.xml

<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>Custom - %d{HH:mm:ss.SSS} %-5level %msg%n</pattern>
        </encoder>
    </appender>

    <root level="trace">
        <appender-ref ref="STDOUT" />
    </root>
</configuration>

Use JAVA_OPTS instead of JVM_OPTS


/usr/bin/chronos is a bash wrapper that runs java and attached binary if no jar i provided. It setup all java options and accept configurations only with JAVA_OPTS in noting provided then only -Xmx512m is set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM