puppetdb 2.x disable some logging

38 views
Skip to first unread message

Johan De Wit

unread,
Apr 14, 2017, 2:52:04 AM4/14/17
to puppet...@googlegroups.com
Hi, 

Anyone knows how to disable the logging of follwing entries in puppetdb 2.3.8 ?

2017-04-14 08:48:07,063 WARN  [c.p.p.h.event-counts] The event-counts endpoint is experimental  and may be altered or removed in the future.
2017-04-14 08:48:07,065 WARN  [c.p.p.h.server] v4 query API is experimental and may change without warning. For stability use the v3 api.
2017-04-14 08:48:07,071 WARN  [c.p.p.h.event-counts] The event-counts endpoint is experimental  and may be altered or removed in the future.
2017-04-14 08:48:07,073 WARN  [c.p.p.h.server] v4 query API is experimental and may change without warning. For stability use the v3 api.
2017-04-14 08:48:07,079 WARN  [c.p.p.h.event-counts] The event-counts endpoint is experimental  and may be altered or removed in the future.
2017-04-14 08:48:07,081 WARN  [c.p.p.h.server] v4 query API is experimental and may change without warning. For stability use the v3 api.
2017-04-14 08:48:07,088 WARN  [c.p.p.h.event-counts] The event-counts endpoint is experimental  and may be altered or removed in the future.

We do need the apiv4 for some application, and above messages are eating up our logdisks.

I'm looking at the logback.xml, but still don't get it how to configure it ...

Thx

Johan

--
Johan De Wit

Open Source Consultant -- Open-Future

Red Hat Certified Engineer (805008667232363)
Puppet Certified Professional 2013/2014/2015/2016 (PCP0000006)
Puppet Certified Instructor
blog : http://johan.koewacht.net/    gsm: +32 474 42 40 73

 

Johan De Wit

unread,
Apr 14, 2017, 3:25:46 AM4/14/17
to puppet...@googlegroups.com

First step i did :


added the following to logback.xml [%logger{36}] 

<appender name="F1" class="ch.qos.logback.core.FileAppender">
        <file>/var/log/puppetdb/puppetdb.log</file>
        <append>true</append>
        <encoder>
            <pattern>%d %-5p [%c{2}][%logger{36}] %m%n</pattern>
        </encoder>
    </appender>


this changed te logging to ...

2017-04-14 09:11:13,170 WARN  [c.p.p.h.server][com.puppetlabs.puppetdb.http.server] v4 query API is experimental and may change without warning. For stability use the v3 api.
2017-04-14 09:11:13,179 WARN  [c.p.p.h.event-counts][c.p.puppetdb.http.event-counts] The event-counts endpoint is experimental  and may be altered or removed in the future.


then I added the following to the logback.xml

    <!-- Disable flooding of API 4 warnings -->
    <logger name="com.puppetlabs.puppetdb.http.server"
        level="error"/>
    <logger name="c.p.puppetdb.http.event-counts"
        level="none"/>


The Api log messages are gone now, still looking how to disable the event-counts message.


Grts


Johan



--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/zarafa.58f07184.52ad.61916d7650418340%40zarafa7.open-future.be.
For more options, visit https://groups.google.com/d/optout.

Johan De Wit

unread,
Apr 14, 2017, 3:55:30 AM4/14/17
to puppet...@googlegroups.com

Finally i added a filter to remove those messeges :

     <filter class="ch.qos.logback.core.filter.EvaluatorFilter">      
     
<evaluator> <!-- defaults to type ch.qos.logback.classic.boolex.JaninoEventEvaluator -->
       
<expression>return message.contains("The event-counts endpoint is experimental");</expression>
     
</evaluator>
     
<OnMismatch>NEUTRAL</OnMismatch>
     
<OnMatch>DENY</OnMatch>
   
</filter>


in the appender section.



https://logback.qos.ch/manual/filters.html


grts


Johan


Reply all
Reply to author
Forward
0 new messages