0

I have defined a small logback.xml file.

My application shows the messages of the logger TM although I don't have any information in the file concerning TM. I want to disable the TM messages, but they still appears in the console.

Console output:

2016-02-19 16:52:36.147  INFO 7943 --- [  rm003Main] TM                                       : [1080]    Op: HUM
2016-02-19 16:52:36.147  INFO 7943 --- [  rm003Main] las                                      : [1346829894] Spent
2016-02-19 16:52:36.147  INFO 7943 --- [  rm003Main] TM                                       : [1081]    Op: HUM
2016-02-19 16:52:36.147  INFO 7943 --- [  rm003Main] las                                      : [1346829894] Spent

logback.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>logs/ethereum.log</file>

        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
        </filter>


        <append>true</append>
        <encoder>
            <pattern>%-5relative %-5level %logger{35} - %msg%n</pattern>
        </encoder>

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>logs/reporter-%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <maxFileSize>50MB</maxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
    </appender>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">

        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>INFO</level>
        </filter>
        <logger level="WARN" name="wallet"/>
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} %-5level %logger{35} - %msg%n</pattern>
        </encoder>
    </appender>
</configuration>

If I add at the end of the .xlm the logger TM, then I could understand that the messages should be shown:

    <logger level="WARN" name="TM"/>
    <logger level="WARN" name="las"/>

</configuration>

Does anybody know what should be changed in the logback.xml in order to avoid the TM messages?

Thanks in advance S.

Sky Dog
  • 415
  • 1
  • 5
  • 9
  • What is the problem exactly @SkyDog ? do you want to disable TM logger ? If so you can achieve this by putting the level to `OFF`, or commenting the logger in logback.xml. – Youssef NAIT Feb 19 '16 at 23:58
  • I have added to the file the following code ' ', but the messages still appear. They are generated in a thread. Must I do something different if they are generated in a thread? – Sky Dog Feb 21 '16 at 22:29
  • What about commenting the logger in logback ? – Youssef NAIT Feb 21 '16 at 22:36
  • If I comment the **TM** entry, no change happens, I mean, I still see the messages. I don't know what I am doing wrong – Sky Dog Feb 21 '16 at 22:58
  • If you have commented the entry and you still getting he TM logs then you're modifying the wrong logback configuration file, do you restart whrn you modify the logback configuration file ? – Youssef NAIT Feb 21 '16 at 23:02
  • Hi NAIT, yes, I restart when I change the logback configuration file. I am really lost. I have changed many parts of the logback.xml but I still see the messages. I only have one logback.xml file in the path, therefore I have no idea whatelse to do (http://pastebin.com/fvytXWhF) – Sky Dog Feb 22 '16 at 20:37
  • well it's kind of weird, if you comment totaly the TM logger and you still get log message from TM, then you must be missing something, try to comment it and let me know. – Youssef NAIT Feb 22 '16 at 20:54
  • If I comment it, then no changes occurs. I have deleted the option -Dlogback.configurationFile from the command line, and no changes. Is there a way to find within the report from where is read the logback configuration? I miss something and I don't know where else to search. Suggestions are welcomed – Sky Dog Feb 23 '16 at 10:55
  • If you don't provide a logback configuration file, it will try to find a configuration file in your classpath, the good news is:you can know what logback configuration file, is used in your programme, all you have to do, is add the following to your Java system properties `-Dlogback.statusListenerClass=ch.qos.logback.core.status.OnConsoleStatusListener`, you can find more details on this [post](http://stackoverflow.com/questions/18922730/how-can-i-determine-what-log-configuration-source-logback-actually-used), check it and let me know ;) – Youssef NAIT Feb 23 '16 at 13:30
  • That's good info, but I am pointing correctly the logback.xml. Here is the console log where it is shown that the logger **VM** and **gas** are deactivated [off](https://gist.github.com/skydogch/ac2cc84af0f4d8bf5262#file-test-L12-L13). Here are the messages of the logger **VM** and **gas** although they have been deactivated [messages](https://gist.github.com/skydogch/ac2cc84af0f4d8bf5262#file-test-L259-L263). Here is my logback [file](https://gist.github.com/skydogch/ca3aad612b6cc89252cd#file-logback-xml-L23-L24). Really, I don't know what else to do :-( – Sky Dog Feb 28 '16 at 22:39

0 Answers0